Performance Bottleneck Identifier
Identify performance bottlenecks through code-level profiling analysis, hot path detection, resource constraint mapping, and throughput limiter identification.
Guiding Principle
"Optimize the bottleneck. Everything else is noise until the constraint moves."
Procedure
Step 1 — Hot Path Detection
- Trace the critical request path from entry point to response.
- Identify synchronous blocking points in async codebases.
- Map I/O operations: database queries, HTTP calls, file system access on the critical path.
- Detect serialized operations that could be parallelized.
- Flag computational hotspots: large data transformations, sorting, serialization
[HECHO].
Step 2 — Resource Constraint Analysis
- Identify CPU-bound operations: heavy computation, encryption, compression.
- Find memory-bound operations: large object allocation, buffer copying, cache size.
- Detect I/O-bound operations: disk reads, network calls, database round-trips.
- Check for thread/connection pool exhaustion patterns.
- Map resource contention: locks, mutexes, shared state between request handlers
[HECHO].
Step 3 — Throughput Limiter Identification
- Calculate theoretical throughput based on resource constraints.
- Identify the single biggest constraint (Theory of Constraints).
- Check for backpressure mechanisms: what happens when the system is overloaded?
- Assess queue depths and processing rates for async workloads.
- Detect cascading failures: when one bottleneck causes others to degrade.
Step 4 — Bottleneck Report
- Rank bottlenecks by impact on user-facing latency.
- Provide specific optimization recommendations per bottleneck.
- Estimate improvement potential for each fix.
- Produce a latency breakdown diagram showing time spent in each component.
Quality Criteria
- Bottlenecks identified on actual critical paths, not theoretical
[HECHO]
- Resource constraints specified with type (CPU/memory/I/O/network)
- Optimization estimates include reasoning
[INFERENCIA]
- Theory of Constraints applied to identify the single biggest limiter
Anti-Patterns
- Optimizing non-bottleneck code (no improvement until the constraint moves)
- Profiling only in development without production-like data volumes
- Treating all slow queries equally without checking if they're on the hot path
- Adding caching without understanding invalidation requirements