performance-optimization
Skill1 starsChanged 49 days agoMITView on GitHub
Make slow code or systems faster by measuring first. Profile the real hot path, fix algorithmic complexity before micro-optimizing, and verify with the same measurement. Use when something is slow or needs to be faster. Never guesses at the bottleneck.
125 other projects use a version of this.
Adopted by
Most recently taken up by
- valentinesamuel/claude-skillstheir own version, first seen Nov 8, 2026
- ishandutta2007/Awesome-Claude-Skillstheir own version, first seen Nov 8, 2026
- ishandutta2007/Awesome-Agent-Skillstheir own version, first seen Nov 8, 2026
- paramcodes/skillstheir own version, first seen Nov 8, 2026
- nisarth/claude-skills-storetheir own version, first seen Nov 8, 2026
- DnsQueen/orcinus-skillstheir own version, first seen Nov 8, 2026
Used with
Projects with it also use constraint-driven-development, git-workflow-and-versioning and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
MrCipherSmithSkillconstraint-driven-development
Use when a project needs a persistent, measurable quality bar — starting a project without documented standards, 'set up constraints', or when coverage/perf/a11y thresholds get re-debated per-PR. Produces CONSTRAINTS.md with enforceable numbers, ratchets, and a guard against silent weakening. NOT for throwaway prototypes or a one-off CI setup.
Also in 15 projects that use this
LLl0k0laDSkillgit-workflow-and-versioning
Use when making any code change. Use when committing, branching, resolving conflicts, or when you need to organize work across multiple parallel streams.
Also in 42 projects that use this
LLl0k0laDSkillusing-agent-skills
Use when starting a session or when you need to discover which skill applies to the current task. This is the meta-skill that governs how all other skills are discovered and invoked.
Also in 33 projects that use this
HK-hubSkilldeprecation-and-migration
Manages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when deciding whether to maintain or sunset existing code.
Also in 39 projects that use this
ukanwatSkillinput-systems
Architect game input — action mapping (abstracting keys into named actions), rebinding with conflict detection and persistence, multi-device support (keyboard, gamepad, touch), analog deadzones, and feel features like input buffering and coyote time, plus accessibility. Engine-neutral. Use when the user mentions input mapping, rebind controls, gamepad support, deadzone, input buffering, coyote time, or accessible controls.
Also in 4 projects that use this
HK-hubSkillobservability-and-instrumentation
Instruments code so production behavior is visible and diagnosable. Use when adding logging, metrics, tracing, or alerting. Use when shipping any feature that runs in production and you need evidence it works. Use when production issues are reported but you can't tell what happened from the available data.
Also in 31 projects that use this
- +6 more from LLl0k0laD
Other versions125 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 125
- addyosmani/agent-skills★ 114ksame name
- sanity-io/sanity★ 6.4ksame name
- gamedev-skills/awesome-gamedev-agent-skills★ 6.4ksame name
- compozy/compozy★ 2.9ksame name
- ollaya-dev/ollaya★ 1.4ksame name
- buddy-compiler/buddy-mlir★ 773same name
- ThibautBaissac/rails_ai_agents★ 665same name
- derHaken/SuperAntigravity★ 439same name
- ukanwat/aaabench★ 399same name
- ukanwat/overtime★ 399same name
115 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository32 other files it gives its agents.
- agent-system-designSkill
- api-contract-designSkill
- architecture-designSkill
- architecture-optimizationSkill
- ci-speedupSkill
- code-handoffSkill
- cross-ai-handoffSkill
- crypto-storage-auditSkill
- database-designSkill
- dataset-sourcingSkill
- distributed-debuggerSkill
- embedded-constrained-codingSkill
- freedom-to-operate-analysisSkill
- frontend-architectureSkill
- github-masterSkill
- idea-finderSkill
- ieee-paper-drafterSkill
- memory-leak-hunterSkill
- ml-model-selectionSkill
- ml-security-auditSkill
- mobile-platform-architectureSkill
- observability-designSkill
- patent-drafterSkill
- patent-novelty-evaluatorSkill
- project-scaffoldingSkill
- researcher-evaluatorSkill
- researcherSkill
- safety-compliance-scopingSkill
- scale-refactorSkill
- secure-code-reviewSkill
- slow-query-optimizerSkill
- test-architectSkill
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 4 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 110 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Stop when the target is met: Don't keep optimizing past it.
- Very specific: line 14
Load the tool list: Read references/profilers.md from this skill's base directory together with the code, in the same step.
- Distinctive: line 20
If you can't run code in this environment, say so, give the user the exact profiling command to run, and work from their output.
- Distinctive: line 37
Micro-optimization: only if the profile still points at the same spot after 1–3.
- Distinctive: line 39
Don't touch code that isn't on the hot path, however inefficient it looks.
“Common” is measured: kept by at least 6 in 10 of the 110 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Performance Optimization
"It's probably the loop" without a profile is a guess that costs a day when it's wrong. Measure, fix the biggest thing the measurement shows, measure again, and stop when the target is met.
1. Set scope and budget
- Agree on the target. What metric (p50/p95 latency, throughput, runtime, memory), on what input, and what number counts as done. If the user didn't give one, propose one and continue.
- Stop when the target is met. Don't keep optimizing past it. Each extra change adds risk for no requested benefit.
- Load the tool list. Read
references/profilers.mdfrom this skill's base directory together with the code, in the same step. It names the right profiler and benchmark method for the language at hand.
2. Measure before changing anything
- Reproduce the slowness with a repeatable command and record the baseline number. Use realistic input size: a 100-row test hides an O(n²) that 1M rows exposes.
- Profile the dimension that matches the complaint: CPU, wall-clock/I-O wait, memory, or database queries.
- If you can't run code in this environment, say so, give the user the exact profiling command to run, and work from their output. Don't present a guess as a measurement.
3. Classify the bottleneck
From the profile, decide which kind it is:
- CPU-bound: time is spent computing.
- I/O-bound: time is spent waiting on network, disk, or database. A faster loop changes nothing here.
- Memory-bound: allocation, garbage collection, or swapping dominates.
Pick the fix direction only after this.
4. Fix in order of leverage
- Algorithm or query shape: O(n²) → O(n log n), N+1 queries → one batched query, repeated work → computed once. This usually beats everything else combined.
- Data structure: list membership → set lookup, repeated string concatenation → join or a buffer.
- I/O pattern: batching, concurrency, caching, an index.
- Micro-optimization: only if the profile still points at the same spot after 1–3.
Don't touch code that isn't on the hot path, however inefficient it looks.
5. Verify the same way
Re-run the exact baseline command on the same input. Report before and after on the metric that was agreed, and confirm the output is unchanged (same result, or the test suite passes). A faster wrong answer is a regression.
Output
## Result
<metric>: <before> → <after> (<n>× faster) on <input>.
## Bottleneck
<what the profile showed, with the key numbers>, <CPU / I-O / memory>-bound.
## Change
<the fix, as a diff or code>, and why it was picked over the alternatives.
## Verified
<command re-run>, <output unchanged: how checked>.For example: "Runtime: 41.8 s → 0.6 s (70×) on 50,000 rows. cProfile shows 97% of time in list.__contains__ inside dedupe(): membership tests on a list, O(n²)."
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

