Performance debugging dies of premature theorizing: the team optimizes the suspected hotspot while the real one idles unprofiled. This setup investigates a dashboard that got four times slower over a month: the performance strategy demands measurement before hypothesis (where does the time actually go?), separates latency from throughput from memory — different causes, different fixes — and reasons at production scale, where the checklist lives: N+1 queries, hot-path allocations, blocking calls, cache misses, expensive loops. The month-long degradation timeline is itself evidence: what grew?
How to use this resource
1
Locate before explaining
The first demand is a measurement plan: where do the 8 seconds go? Theories come after the profile.
2
Use growth as evidence
4× slower over a month with no deploy points at data volume — the timeline narrows the suspects.
3
Validate with a toggle
The gold standard applies: turn the suspected cause off (cache it, limit it) and watch the metric move.
Why This Works
Measurement-first ordering prevents optimizing the wrong thing well
The latency/throughput/memory split routes each symptom to its own cause family
Scale reasoning finds the problems that test environments are too small to show
Best for
Pages and jobs that got slower without a deploy to blame
Systems where "it's the database" is assumed, not measured
Performance work that must justify its engineering time
Not for
Writing performance tests after the fix — that's the Test Case Prompt Generator's performance coverage
Reviewing code for performance smells without a live problem — that's the Code Review Prompt Generator
Use cases
Diagnosing gradual slowdowns that track data growth
Separating database time from render time before optimizing either
Finding the N+1 that was invisible at last year's scale
FAQ
Why does this debugging prompt refuse to name a root cause right away?
Because it forces measurement first — "Identify WHERE time or memory goes before asking why — measurement precedes hypothesis." The framework runs ten ordered stages, reaching FIX RECOMMENDATION only after EVIDENCE REVIEW, and makes you "Carry at least two hypotheses until evidence separates them." That prevents optimizing a suspected hotspot. It generates the investigation prompt; you run it and validate against your real profiler data.
How do I actually confirm the cause this prompt points at?
By the gold standard it names: "a reproduction that turns the failure on and off by toggling the suspected cause" — cache it or limit it and watch the metric move. Every statement is labeled FACT, ASSUMPTION, or HYPOTHESIS, and each hypothesis ships with its test. The prompt structures that plan; you execute the toggle and read your own monitoring to declare the slowdown resolved.
"Fix this error" gets guesses. The investigation contract gets a ten-stage diagnosis: facts separated from assumptions, alternatives weighed, fixes justified.
"Refactor this code" invites silent behavior changes. The refactoring contract preserves business rules, outputs, and side effects — and flags uncertainty instead of deciding it.
The full path to taming an inherited codebase — understand it, document its architecture, pin its behavior with tests, then refactor, modernize, review, speed up, and ship it without breaking what works.
Speed up code that works but drags — find the actual hot path instead of guessing, understand why it's slow, optimize it, and prove with tests that you changed the speed and nothing else.
Ask AI to "review this for performance" and you get a tidy list of smells with no idea which one production actually spends time on. Here is how to review code for performance with AI so each finding is tied to a workload, ranked by evidence, and marked with the measurement that would confirm it.
Software Development with AI
Tip: Save time by exploring related resources and tools that integrate with this resource.
Feedback
Send feedback to NewPrompt
Found a bug, have a suggestion, or want to report something confusing? Send a short note.
Cookie preferences
NewPrompt uses optional Google Analytics cookies to understand site usage and improve the tools.
The site works normally if you decline analytics cookies.
Read more in our Cookie Policy.