performance
Use when something is slow, before optimising anything, and when a change touches a hot path.
by crewforth★ 26 GitHub stars
Install performance in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
About this skill
Performance
Trigger phrases: "performance", "slow", "optimization", "profiling", "N+1", "latency", "memory leak", "leaked memory", "load test", "seconds to open", "seconds to respond", "anything slower", "make it slower"
Core rule: measure first, optimize later. Optimization without measurement is a guess; it usually speeds up the wrong place and adds complexity. Stack-agnostic; do a web search when you need the profiling tool/library.
Method (in order)
Set a target — what is "acceptable"? (p95 latency, throughput, memory ceiling). Numeric.
Measure — find the real bottleneck with a profiler/APM/benchmark; don't start from a guess.
Fix the single most expensive thing — Amdahl: speeding up a 5% path by 2x is wasted; target the hot path.
Measure again — did it actually improve, is there a regression. Run each side enough times to see the run-to-run noise, then decide:
Result against the noise Decision Better by more than the noise Keep Within the noise Revert: no measured gain is no gain Worse, or a test went red Revert A reverted attempt is written down (in the PR, or the doc that holds the measurements) with its number, so a discarded idea stays discarded. 4b. Same answers before same speed. An optimisation of a pure function is kept only after a differential check: the original and the new version run on generated inputs (empty, one item, repeated values, sorted, reverse-sorted, extreme sizes, typical) and return the same results. Then time the new one on its own worst input shape, not only the benchmark's.
Stop — once you hit the target, finish; no endless micro-optimization.
Common bottlenecks
Catalog of common bottlenecks + fixes to consult: references/bottlenecks.md.
Measurement tips
- Measure under load (a single request misleads); with a realistic data volume.
- Not p50, but p95/p99 — tail latency is what burns the user.
- Don't trust micro-benchmarks; an end-to-end profile is more honest.
- A web page: the Core Web Vitals thresholds, field against lab data, and what makes up LCP:
references/web-vitals.md.
Symptom → cause → fix
| Symptom | Usual cause | Fix |
|---|---|---|
| List page gets slower as data grows | N+1 queries, or no pagination | one query with a join or batch load; paginate |
| Fast locally, slow in production | the data volume, or a missing index | measure with production-sized data; EXPLAIN the query |
| Typing or scrolling stutters | work on every keystroke or render | debounce, memoize, virtualize long lists |
| Memory grows until a restart | listeners, timers or caches never released | remove them on teardown; bound every cache |
| First load slow, later loads fine | a large bundle or an unoptimised hero image | split the bundle, lazy-load below the fold, size the image |
Invariant rules
- Don't optimize without measuring — a change without a profile = a guess.
- Target the hot path — don't speed up the small share.
- Don't break correctness — don't sacrifice behavior/edge cases for speed.
- Complexity budget — make an optimization that seriously hurts readability only if there is a measured gain; comment it.
- Stop once you hit the target — YAGNI; no premature/excessive optimization.
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
Bundled files
- references/bottlenecks.md
- references/web-vitals.md
FAQ
What does the performance skill do?
Use when something is slow, before optimising anything, and when a change touches a hot path.
How do I install the performance skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the performance skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
theme-factory
AnthropicToolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
access
AnthropicManage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
configure
AnthropicSet up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
access
AnthropicManage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…