Vibe Coded App Performance Issues: Why Your App Is Slow
Most vibe coded app performance issues trace back to four patterns the AI had no reason to avoid: database queries that run once per row instead of once per page, missing indexes, whole tables fetched and then filtered in the browser, and full-size images shipped to render as thumbnails. None of them are visible while you build, because your seed data is tiny and your laptop is fast. They surface when real data and real users arrive. The fix order is always the same: measure before you change anything, fix the single worst offender, measure again.
What causes vibe coded app performance issues?
In apps generated with Cursor, Lovable, Bolt, v0 or Replit, slowness is rarely one big mistake. It is a stack of small, reasonable-looking decisions. These are the ones worth checking first:
- The N+1 query. The list page fetches 50 orders, then each order card fetches its own customer. That is 51 round trips where one join would do. AI assistants produce this constantly, because each component was generated in isolation and fetching its own data is the self-contained answer.
- No indexes. Generated schemas usually have a primary key and nothing else. A query filtering on user_id or created_at with no index on those columns forces a full table scan. At 200 rows nobody notices. At 200,000 the page times out.
- Fetching everything, filtering client-side. select * on the whole table, then .filter() in JavaScript. It is correct, it passes every manual test, and it moves the entire dataset over the network on every page view.
- No pagination. The dashboard renders every row that exists. Fine on day one, fatal at month six.
- Unoptimised images. A 4 MB upload rendered in a 120 px avatar slot, no resizing, no lazy loading, no width and height attributes — which also causes layout to jump as images land.
- Request waterfalls. Sequential await calls that do not depend on each other. Three independent 300 ms fetches become 900 ms instead of 300 ms.
- Re-render storms. State held too high in the tree, or new object and array literals passed as props, so a whole page re-renders on every keystroke in one input.
- Dependency bloat. A whole date or utility library installed to use one function, bundled and shipped to every visitor.
Why does AI-generated code look fast while you are building it?
Because the conditions that expose the problem do not exist yet. Three structural reasons:
Your test data is tutorial-sized. A missing index, an N+1 query and a full-table fetch all behave identically to correct code when the table has a dozen rows. Performance bugs are the one class of defect that scale, rather than logic, makes visible — so the usual "it works when I click through it" check cannot catch them.
Each prompt is answered in isolation. The model writes one component, one route, one query at a time. Nothing in that context window describes how many queries the page as a whole will fire, so no single generated file looks wrong. The inefficiency is an emergent property of the assembled app.
Training data skews towards illustration. Tutorial and example code optimises for being readable and short, not for production data volumes. Caching, pagination, joins and indexes are the parts examples leave out, so they are the parts generated code tends to omit too — a close cousin of the problem described in AI technical debt.
How do you find out what is actually slow?
Do not guess, and do not start optimising the code you happen to remember writing. Open your browser's developer tools and work through four checks in order:
- Network panel, sorted by duration. Reload the slow page and sort requests by time. If one API call dominates, the problem is on the server or in the database. If you see dozens of near-identical calls to the same endpoint, that is your N+1. If the biggest rows are images or JavaScript bundles, the problem is payload, not logic.
- Lighthouse. Built into Chrome DevTools. Run it on the deployed URL rather than localhost, and read the opportunities list — it names unoptimised images, unused JavaScript and render-blocking resources specifically.
- Performance panel recording. Record while you interact. Long unbroken blocks of scripting point at re-render problems; use the React DevTools Profiler to see which components re-rendered and why.
- The database side. In Postgres (including Supabase and Neon) run EXPLAIN ANALYZE on the slow query. A sequential scan on a large table means you need an index. Hosted dashboards usually surface slowest queries directly.
For judging the result, Google publishes the Core Web Vitals thresholds, assessed at the 75th percentile of real page loads:
| Metric | What it measures | Good | Poor |
|---|---|---|---|
| LCP | Time until the main content renders | 2.5s or less | Over 4s |
| INP | Responsiveness to a user interaction | 200ms or less | Over 500ms |
| CLS | Unexpected layout shift during load | 0.1 or less | Over 0.25 |
These are the numbers to hold your app against — not a subjective sense that it "feels fine on my machine".
Which fixes give the biggest win first?
Match the symptom to the cause rather than refactoring broadly:
| Symptom | Likely cause | Fix |
|---|---|---|
| Dozens of identical API calls on one page | N+1 query | One query with a join or an in filter; fetch at the page level and pass data down |
| One API call takes seconds, worsening over time | Missing index or full table scan | Add an index on the filtered and sorted columns; confirm with EXPLAIN ANALYZE |
| Huge JSON response, fast server | Fetching all rows, filtering client-side | Move filters, sorting and limits into the query; add pagination |
| Slow first paint, large image requests | Unoptimised images | Resize and compress, serve modern formats, add lazy loading plus width and height |
| Typing or clicking feels laggy | Re-render storm | Move state down to the component that uses it; memoise expensive children |
| Page loads in steps, each waiting on the last | Request waterfall | Run independent fetches in parallel; move data fetching to the server where your framework supports it |
Two rules make this safe. Change one thing at a time, so you know which change helped. And test against realistic data volume — seed a few thousand rows before you declare a query fixed, or you have proved nothing.
How do you stop performance issues from coming back?
Re-prompting reintroduces these patterns. The next feature request regenerates a component that fetches its own data, and you are back where you started. What holds is a check that runs without you remembering to run it:
- Run Lighthouse on every deploy and treat a dropping score as a failure, not as information. Even a manual run on the live URL after each release beats discovering it from a user.
- Keep a seeded staging dataset that is larger than your real one. It is the only reliable way to make scale bugs appear before customers do.
- Cover your money flows with tests that assert outcomes, so you notice when a page stops loading entirely. Adding tests to a vibe-coded app is the lowest-effort version of this.
- Make slowness easy to report. Users rarely file performance complaints, and when they do, they arrive as "it's slow sometimes" with no page, no timing and no network detail. Klavity Snap captures the page, console and network activity at the moment of the right-click, which turns that into something diagnosable.
- Exercise real journeys automatically. Sims walk your app as personas and surface pages that fail or stall, and AutoSim keeps those journeys running as self-healing end-to-end tests so a regression shows up on the deploy that caused it. For how this fits a full process, see the complete guide to AI QA.
Find the slow pages before your users do
Performance problems in AI-generated apps are predictable, which makes them findable. Measure first, fix the worst thing, add a check that runs on every deploy — and get the evidence from real sessions instead of from a support message that says "it's slow". Try Klavity free and scan your app before your next release.
Key takeaways
- Measure with DevTools and Lighthouse before changing any code
- Check for N+1 queries and missing indexes first — they cause most slowdowns
- Seed a few thousand rows so scale bugs appear before users find them
- Run a performance check on every deploy, not once at launch
FAQ
Why is my vibe coded app slow even though it worked fine yesterday?
Because performance bugs scale with data, not with code. A missing index or an N+1 query behaves exactly like correct code on a few hundred rows, then degrades sharply as the table grows. Nothing changed in your code; the row count changed.
What is an N+1 query and why does AI code produce so many?
An N+1 query is one query to fetch a list, plus one more query per item in it. AI assistants generate each component in isolation, so having every card fetch its own data is the natural self-contained answer. The cost only appears once the whole page is assembled.
Can I just ask the AI to make my app faster?
Only after you have measured. Without profiling data the model guesses, and it will usually rewrite code that was not the bottleneck. Paste the specific slow query, the DevTools timing or the Lighthouse opportunity into the prompt and it becomes a far more reliable fix.
How much test data do I need to catch performance problems?
Enough that a full table scan hurts. A few thousand rows in your largest tables is usually sufficient to make missing indexes and unpaginated lists obvious, and it is far closer to production than the handful of seed rows most generated apps ship with.
Which should I fix first, the database or the front end?
Whichever your Network panel blames. If one API call dominates the waterfall, fix the query. If the largest rows are images and JavaScript bundles, fix the payload. Sorting requests by duration answers this in under a minute.
Catch bugs the moment a human sees them
Klavity: right-click bug reports, AI personas that review your product, and self-healing tests.
Get started free