| name | Performance Audit |
| description | Use when analyzing performance bottlenecks or optimizing critical code paths.
Finds N+1 queries, blocking I/O, memory leaks, and algorithmic complexity.
Read-only analysis with optional benchmarking via Bash.
|
| when_to_use | "why is this slow?", "profile this", "find the bottleneck",
"N+1 query", "optimize this path"
|
| context | fork |
| agent | Explore |
| allowed-tools | Read, Grep, Glob, Bash |
| disallowed-tools | Edit, Write, NotebookEdit |
| disable-model-invocation | true |
Performance Audit Skill
Analyze codebase for performance issues and optimization opportunities.
Analysis Steps
-
N+1 Query Detection
- Search for loops containing database calls
- Identify missing eager loading patterns
- Check for batch vs single-record operations
-
Blocking Operations
- Find synchronous I/O in async contexts
- Identify missing concurrency patterns
- Check for sequential operations that could parallelize
-
Memory Leak Patterns
- Look for unbounded caches or collections
- Identify missing cleanup in event listeners
- Check for circular references preventing GC
-
Caching Analysis
- Review existing cache implementations
- Identify cache-worthy operations (expensive, repeated)
- Check cache invalidation strategies
-
Algorithm Complexity
- Review nested loops for O(n²) patterns
- Check for unnecessary repeated computations
- Identify opportunities for memoization
Benchmark Commands
node --prof app.js && node --prof-process isolate-*.log
python -m cProfile -s cumulative script.py
go test -bench=. -benchmem ./...
cargo bench
Output Format
Report findings with impact assessment:
- Critical: >100ms latency impact
- High: 10-100ms latency impact
- Medium: Measurable but < 10ms
- Low: Micro-optimization opportunity