Performance Investigation
- Define the user-visible metric and target: latency percentile, throughput, memory, cost, or startup time.
- Measure a representative baseline.
- Profile to locate the dominant bottleneck.
- Form a hypothesis and change one factor.
- Re-measure under equivalent conditions.
- 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.