perf-lab
Diagnose and improve performance with measurements. Use when the user asks about slow code, latency, throughput, memory, bundle size, database query cost, rendering jank, profiling, benchmarking, or o
Files2
View on GitHubSKILL.mdskills/perf-lab/SKILL.md
GitHubPerf Lab
Optimize only after creating a measurement loop.
Workflow
- Define the target metric: latency, throughput, memory, CPU, query count, bundle size, render frames, or startup time.
- Build a baseline using the repo's tools first: benchmark, profiler, logs, trace, query plan, browser performance panel, or a focused script.
- Reproduce the slow path with representative data.
- Rank hypotheses by likely impact and cost.
- Change one variable at a time.
- Compare before/after numbers and preserve behavior with tests where possible.
Common Checks
- Accidental N+1 queries or missing indexes.
- Repeated parsing, serialization, regex, or filesystem work.
- Unbounded loops, deep copies, or needless allocations.
- Chatty network calls or waterfall loading.
- Large client bundles, hydration cost, and expensive renders.
- Cache invalidation that is too broad or too sticky.
Output
Include:
- Baseline command and result.
- Hypotheses considered.
- Changes made or recommended.
- After result.
- Tradeoffs and remaining bottlenecks.
If measurement is blocked, state the missing fixture, traffic shape, or profiler access instead of guessing.