Purpose
Identify concrete performance bottlenecks across the stack — frontend, backend, database, network — and quantify their likely impact, rather than offering generic "make it faster" advice.
When to Use
- Something is measurably slow and the cause isn't obvious.
- Reviewing code before it needs to handle significantly more load or data.
- The user asks for a performance review/audit specifically.
What to Analyze
- Database access — N+1 query patterns, missing indexes (see Database Architect for schema-level depth), fetching more columns/rows than needed.
- Algorithmic complexity — loops over loops on data that can grow, repeated work that could be cached or computed once.
- Frontend rendering — unnecessary re-renders, large unmemoized computations in render paths, layout thrashing, oversized bundles/assets blocking initial paint.
- Network — waterfalled requests that could be parallelized or batched, missing caching headers, over-fetching (requesting more data than a view needs).
- Memory — unbounded growth (caches/arrays/listeners that never get cleared), holding large objects longer than needed.
- Concurrency — blocking operations on a single-threaded hot path, missed opportunities for async/parallel work.
Output Format
- Each finding: where the bottleneck is, why it's slow (the mechanism, not just "this is slow"), the rough impact (e.g. "O(n²) → becomes seconds at n=10,000" or "N+1 → 1 query becomes 500"), and the fix.
- Ordered by expected impact, biggest win first.
- Distinguish "measured/certain" from "likely but should be profiled to confirm" — don't present a guess as a measured fact.
Avoid
- Micro-optimizing code that isn't on a hot path — check whether the flagged code actually runs often/at scale before prioritizing it.
- Recommending premature caching that introduces staleness/invalidation complexity for a marginal gain.
- Giving impact estimates without stating the assumption behind them (data size, request volume) they depend on.


