BlogVibecode

My AI app suddenly got slow

It was fine with ten rows and crawls at a thousand. Four causes that are nearly always the explanation, from easiest to most annoying to fix.

By Bas Voets5 min read

Getting slow rarely happens gradually. It becomes noticeable all at once, usually around the first real users. That is because most of these causes only start to hurt above a few hundred rows, and until then everything looks fast no matter how much is wrong.

1. Fetching everything and filtering after

The classic. The app fetches the whole table and then finds the right rows in the browser. With thirty rows you notice nothing. With ten thousand you send ten thousand rows over the wire on every visit, of which twenty get shown. Filtering and sorting belong in the database, not in the screen.

2. One request per row

You fetch a list of orders and then ask for the customer name per order. Fifty orders is fifty-one requests. This is the pattern AI tools produce most often, because each piece reads sensibly on its own. One query that brings the customer along replaces the whole pile.

3. No index on what you search by

Searching by email, filtering by status, sorting by date: without an index the database walks every row. At a thousand rows that is invisible and at a hundred thousand it is painful. Adding an index is one line and the effect is usually a factor of ten or more.

4. Images nobody resized

Photos users upload come straight off a phone: four megabytes each. Put twenty on a page and that is eighty megabytes before anything is visible. Resizing on upload fixes this permanently.

Which of the four it is

  • Press F12, Network tab, reload the page. Dozens of similar requests in a row is cause 2.
  • One request that is megabytes large is cause 1.
  • One request that is small but takes seconds is cause 3.
  • Image requests eating most of the time is cause 4.
Slowness is almost never a shortage of servers. It is usually too many questions, or one question that gets too much back.

All four are fixable without rebuilding the app, and you are usually within a day of something that scales. What it does not fix is a data model that is structurally off; you notice that when every repair exposes new slowness somewhere else.

Let's build

Tell me what you
want to build.

A half-hour call. You get an honest answer about what it costs, how long it takes and whether building it is smart at all.

Bas Voets · Webframer
0:00 / 0:00
My AI app suddenly got slow