Engineering Performance Debugging

Debug Performance Problems

Measure before reasoning: find WHERE the time goes, separate latency from memory from throughput, and think at production scale.

Overview

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.

More resources from Debugging Prompt Generator

Resources that pair well

Related tools

Projects that use this resource

Workflows that use this resource

Guides for this resource

Tip: Save time by exploring related resources and tools that integrate with this resource.