← Library06 Playbooks

performance

Performance Investigation

06 Playbooks/Performance Investigation.md

Performance Investigation

  1. Define the user-visible metric and target: latency percentile, throughput, memory, cost, or startup time.
  2. Measure a representative baseline.
  3. Profile to locate the dominant bottleneck.
  4. Form a hypothesis and change one factor.
  5. Re-measure under equivalent conditions.
  6. Check correctness and resource tradeoffs.

Frequent causes

  • Excessive round trips or N+1 queries
  • Wrong algorithm or data structure
  • Unbounded work, memory, queues, or retries
  • Serialization and copying
  • Lock contention and synchronous blocking
  • Cache misses or invalidation mistakes
  • Large assets and main-thread work

Optimize evidence-backed bottlenecks. Preserve before/after measurements with the decision.

Knowledge connections