Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Systematically finds and fixes performance bottlenecks by measuring first, profiling hot paths, reducing algorithmic and I/O cost, and verifying gains with before/after benchmarks. Use this skill when code, an endpoint, a page, a query, or a job is "slow", "laggy", "timing out", "using too much CPU/memory", or "doesn't scale"; when asked to optimize, speed up, profile, or benchmark something; when chasing high latency / low throughput, p99 spikes, memory leaks, N+1 queries, or excessive allocati
.claude/skills/jayrha-performance-profiler/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-21 | ✗→✓ | ▲ Improved | 30% | 0% |
| case-15 | ✓→✓ | = Same ✓ | 76% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 31% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 60% | 0% |
| case-05 | ✓→✓ | = Same ✓ | 78% | 0% |
Make slow things fast — correctly and provably. This skill enforces a measure-driven loop: never optimize on a hunch, always profile to find the real hot path, fix the biggest contributor first, then re-measure to confirm the win and guard against regressions.
Keywords: performance, profiling, optimization, bottleneck, latency, throughput, p99, slow, benchmark, flamegraph, CPU profile, memory leak, allocations, N+1 query, caching, big-O, complexity, hot path, regression.
The cardinal rule: measure first. Most "obvious" optimizations target the wrong code. Profilers routinely show that 90% of time sits in a place nobody suspected.
Follow this loop. Do not skip steps — especially step 1 and step 6.
wall-clock latency (p50/p95/p99), throughput (req/s, rows/s), CPU time, peak memory (RSS), or allocations. Write down the current value and the target. "Make it faster" is not a goal; "cut p95 from 800ms to under 200ms" is.
volume. A bottleneck at 10 rows may vanish at 10M and vice-versa. Disable noise: warm caches, JIT warmup, fixed input, quiet machine, multiple runs.
anything. Save the numbers. Use scripts/bench.py for a quick statistically sane wall-clock benchmark of a Python callable or shell command.
timers) to attribute cost. Find the function/line/query consuming the most time or memory. See references/profiling-tools.md for the right tool per language and how to read its output.
from the optimization hierarchy (see below). Change ONE thing at a time so each change's impact is attributable.
metric improved and correctness is unchanged. Quantify: "p95 800ms → 180ms, -77%". If no improvement, revert and re-profile.
target is met. Add a regression guard (a benchmark assertion or CI check) so the win doesn't rot.
Apply fixes in this order — cheapest/highest-leverage first. Most wins come from the top three.
logging in hot loops. Cache or memoize pure, repeated results. Hoist invariants out of loops. Compute lazily / short-circuit.
use a hash set/map for membership and lookups, sort once instead of repeatedly scanning, use the right data structure. See references/complexity-cheatsheet.md.
the right index, select only needed columns, stream instead of buffering, use connection pooling, paginate. I/O usually dwarfs CPU.
pool for CPU-bound work, vectorize (NumPy/SIMD). Only after single-thread work is minimized — parallelizing a bad algorithm just burns more cores.
collections, use generators/iterators, pick compact representations, cut GC churn.
tuned runtime flags, JIT-friendly code. Last resort — small payoff, high maintenance cost.
I/O (disk, network, DB, locks) — chase step 3/4, not micro-CPU tuning. If wall time ≈ CPU time, attack the algorithm (step 1/2).
help a single cold request's latency. Optimize for the metric you committed to.
caches, or a slow dependency — not the average path. Profile the slow requests specifically.
5% gain. Always spend effort proportional to a section's share of total cost.
release/optimized mode — never profile a debug build and extrapolate).
unrepresentative data/caching, then shipping a non-win.
references/profiling-tools.md — per-language profiler commands (Python,Node/JS, Go, Java, SQL, web/browser), what each measures, and how to read flamegraphs and call trees.
references/complexity-cheatsheet.md — big-O of common operations and datastructures, plus the canonical "swap this for that" optimization patterns (N+1 fix, set-membership, memoization, batching).
scripts/bench.py — runnable benchmark harness: times a Python expression ora shell command over N runs and reports min/median/mean/stdev with a clean comparison mode for before/after.
examples/optimize-n-plus-one.md — full worked example taking a slow endpointfrom 1.9s to 60ms through the whole loop (measure → profile → fix → verify).
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-15 | pass→pass | 10,290 | 8,986 | -13% | 1 | 1 | 0% | 1,748 | 3,082 | +76% | 0 | 0 | — |
case-01 | fail→fail | 19,379 | 15,531 | -20% | 1 | 1 | 0% | 3,349 | 4,323 | +29% | 0 | 0 | — |
case-02 | fail→fail | 23,681 | 16,230 | -31% | 1 | 1 | 0% | 4,565 | 4,857 | +6% | 0 | 0 | — |
case-03 | pass→pass | 14,731 | 9,021 | -39% | 1 | 1 | 0% | 2,450 | 3,211 | +31% | 0 | 0 | — |
case-04 | pass→pass | 12,004 | 10,499 | -13% | 1 | 1 | 0% | 2,215 | 3,533 | +60% | 0 | 0 | — |
case-05 | pass→pass | 9,934 | 9,076 | -9% | 1 | 1 | 0% | 1,794 | 3,199 | +78% | 0 | 0 | — |
case-06 | pass→pass | 15,288 | 10,545 | -31% | 1 | 1 | 0% | 2,318 | 3,426 | +48% | 0 | 0 | — |
case-07 | pass→pass | 13,739 | 8,768 | -36% | 1 | 1 | 0% | 2,312 | 3,221 | +39% | 0 | 0 | — |
case-08 | pass→pass | 10,999 | 6,342 | -42% | 1 | 1 | 0% | 1,753 | 2,702 | +54% | 0 | 0 | — |
case-09 | pass→pass | 10,429 | 8,418 | -19% | 1 | 1 | 0% | 1,877 | 3,065 | +63% | 0 | 0 | — |
case-10 | pass→pass | 9,149 | 9,314 | +2% | 1 | 1 | 0% | 1,611 | 3,343 | +108% | 0 | 0 | — |
case-11 | pass→pass | 9,364 | 6,611 | -29% | 1 | 1 | 0% | 1,794 | 2,861 | +59% | 0 | 0 | — |
case-12 | pass→pass | 8,385 | 7,569 | -10% | 1 | 1 | 0% | 1,482 | 2,972 | +101% | 0 | 0 | — |
case-13 | pass→pass | 15,816 | 28,880 | +83% | 1 | 1 | 0% | 2,505 | 4,437 | +77% | 0 | 0 | — |
case-14 | pass→pass | 11,645 | 6,360 | -45% | 1 | 1 | 0% | 1,770 | 2,710 | +53% | 0 | 0 | — |
case-16 | pass→pass | 12,271 | 13,092 | +7% | 1 | 1 | 0% | 2,231 | 3,889 | +74% | 0 | 0 | — |
case-17 | pass→pass | 9,988 | 9,292 | -7% | 1 | 1 | 0% | 1,956 | 3,369 | +72% | 0 | 0 | — |
case-18 | pass→pass | 8,810 | 8,150 | -7% | 1 | 1 | 0% | 1,474 | 2,942 | +100% | 0 | 0 | — |
case-19 | pass→pass | 5,366 | 3,435 | -36% | 1 | 1 | 0% | 1,032 | 2,315 | +124% | 0 | 0 | — |
case-20 | pass→pass | 6,457 | 8,990 | +39% | 1 | 1 | 0% | 1,258 | 2,505 | +99% | 0 | 0 | — |
case-21 | fail→pass | 15,518 | 11,301 | -27% | 1 | 1 | 0% | 2,740 | 3,573 | +30% | 0 | 0 | — |
case-22 | fail→fail | 7,144 | 8,234 | +15% | 1 | 1 | 0% | 1,225 | 3,078 | +151% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +5 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
| Model | Method | Date | Lift |
|---|---|---|---|
| gemini-3.6-flash | verified | 8/3/2026 | 0% |
Other measured skills in the registry, with their headline benchmark lift.