From demo to production · Carousel

7 performance bugs you didn't write. AI wrote them for you.

The code runs, the demo is smooth. But under the surface sit mistakes that blow up exactly when real users arrive.

The carousel as it was published, slide after slide. Below, the same content as text.

N+1 Queries

One query that became 50

The AI asks for a list of users, and then, inside a loop, pulls each one's details separately. 50 users are 51 calls to the database instead of one.

  • At 200 users this becomes thousands of unnecessary calls. The fix: pull everything in one query.
Before
users.map(u => getOrders(u.id)), a separate call for every user.
After
one query with a join, one call for all of them.

This is the most common mistake AI tools produce, and you can't see it until there's load.

SELECT *

Pulls everything, needs two

You need a name and an email, and the AI pulls all 30 columns, including heavy fields nobody ordered. Every request becomes several times heavier than needed.

  • Fewer columns, a faster response. Always ask only for what's actually displayed.
Before
select *, all 30 columns.
After
select name, email, only the two that are displayed.

"Bring everything just in case" is exactly what weighs down the system without you noticing.

No pagination

Loads 10,000 rows at once

In the demo there are 12 records, so "load everything" works great. In production there are 10,000, and the page gets stuck loading while it tries to pull all of them.

  • The user sees 20 rows, but the browser downloads all 10,000.
  • The fix: load page after page, or infinite scroll that pulls as you go.
  • It doesn't show in development. Only when the table really fills up.

The amount of data grows over time. Code that pulls "everything" breaks on the day success arrives.

No index

Every search scans everything

An index is like a table of contents for a table. Without it, every search goes row after row over the whole table to find a match. 100 rows, fast. A million, stuck.

  • AI almost never adds indexes by itself.
  • On every column you filter or search by, put an index.
  • The difference: from 4 seconds to load to 40 milliseconds.

One right index can be the difference between a fast app and a dead one.

No debounce

Every keystroke is a call to the server

A search field that updates as you type. Sounds nice, but without braking, every letter is a separate request. One word, 8 calls to the server.

  • Fast typing of 20 characters is 20 queries a second.
  • The fix: debounce. Wait for the user to stop typing, and then send.

A feature that feels smooth for a single user can bombard the server when many type together.

Heavy images

4MB instead of 80KB

The AI displays the image as it is, an original 4MB file, and shrinks it only on display. The user still downloads all 4MB for a tiny image.

  • 10 such images on a page are 40MB to download before you see anything.
  • The fix: compress and serve at the right size. Modern formats, lazy loading.

Your page is fast on a fast network. On a real customer's mobile network, it crawls.

Fetch on render

Calls the network in an endless loop

A network call that fires on every re-render of the component. Every small update on the screen triggers another call, and another, sometimes without end.

  • Looks fine in development, until you see dozens of calls in Network. The fix: fetch in the right place and keep the result.
Before
fetch() on every re-render.
After
useEffect(fetch, [deps]), once.

Open the Network tab. If there are more calls there than makes sense, you found a bug.

How to check

Two tabs, five minutes

You don't need expensive tools to catch most of these bugs. The browser's developer tools are enough, and they're already open for you.

  • Network: how many calls go out? How much data comes down? What takes the longest?
  • Performance: what's freezing the page, and where the time really goes.
  • And then fill the data to 10,000 rows and see what happens.

Most performance bugs aren't hiding. It's just that nobody bothered to open and look.

Why it's critical

Slowness costs customers

Performance isn't "nice to have". A page that loads slowly loses users in the first seconds, before they've even seen what you built.

  • Every second of loading lowers conversions and drives users away.
  • These bugs are cheap to fix now, and very expensive after you've launched.
  • The same principle as in security: the AI built it, the responsibility is yours.

The demo convinces an investor. Performance convinces a user to stay.

The AI wrote code that works. Not code that holds under load.

These seven bugs are the difference between an app that impresses in a demo and one that holds real customers.

What closes the chapter

The AI wrote code that works. Not code that holds under load.

Did a post meet you in your system?

Half an hour, the system open, free. You leave with your open decisions.

or on WhatsApp, if it's a single question. Nothing is stored on the site.