dragonked2 / performance-profiling
Identify performance bottlenecks: CPU profiling, memory analysis, I/O optimization, and benchmarking strategies.
0
SKILL.md1.2 KB
Performance Profiling Skill
Systematic performance investigation and optimization.
Process
- Define target — what metric to improve (latency, throughput, memory)
- Baseline — measure current performance under realistic conditions
- Profile — use appropriate profiler for the bottleneck type
- Identify — find the top hotspots (usually 20% of code causes 80% of time)
- Optimize — targeted fix for the biggest bottleneck
- Verify — re-measure, confirm improvement, check for regressions
Profiling Tools by Bottleneck
- CPU: flame graphs, sampling profilers, perf/Instruments
- Memory: heap dumps, allocation trackers, leak detectors
- I/O: strace, network traces, disk benchmarks
- Concurrency: thread analyzers, lock contention profiling
Benchmarking Rules
- Warm up before measuring (JIT, caches, connection pools)
- Run enough iterations for statistical significance
- Measure in production-like environment
- Isolate from noise (dedicated machine, no other workloads)
- Use percentiles (p50, p95, p99), not just averages