performance-profiling
Skill4 starsChanged 4 months agoMITView on GitHub
Finds why something is slow and makes it faster, using measurement rather than intuition. Use this whenever the user says something is slow, mentions latency, throughput, memory usage, a timeout, a slow query, or asks how to optimise code. Also use before any optimisation work, because optimising without a profile is guessing. For code that is producing wrong results rather than slow ones, use debugging.
16 other projects use a version of this.
Adopted by
Most recently taken up by
- nahid-sparktales/agent-dispatchertheir own version, first seen Sep 21, 2026
- VoDaiLocz/kilo-kit-mcptheir own version, first seen Aug 21, 2026
- rshankras/claude-code-apple-skillstheir own version, first seen Jul 16, 2026
- RadekCihlar/Claude-skillstheir own version, first seen Jul 10, 2026
- Sir-chawakorn/sanook-clitheir own version, first seen Jun 21, 2026
- roanbrasil/engineer-grade-agent-skillstheir own version, first seen Jun 17, 2026
Used with
Projects with it also use intelligent-routing, behavioral-modes 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.
tiendatworkSkillintelligent-routing
Automatic agent selection and intelligent task routing. Analyzes user requests and automatically selects the best specialist agent(s) without requiring explicit user mentions.
Also in 3 projects that use this
xfstudioSkillbehavioral-modes
AI operational modes (brainstorm, implement, debug, review, teach, ship, orchestrate). Use to adapt behavior based on task type.
Also in 3 projects that use this
xfstudioSkillred-team-tactics
Red team tactics principles based on MITRE ATT&CK. Attack phases, detection evasion, reporting.
Also in 3 projects that use this
benshapyroSkilldocumentation-templates
Generates README files, API documentation, and inline code comments following best practices. Use when creating project documentation, writing READMEs, documenting APIs, or explaining complex code.
Also in 3 projects that use this
- +8 more from xfstudio
Other versions16 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 16
- rshankras/claude-code-apple-skills★ 777same name
- conorluddy/xclaude-plugin★ 182same name
- HeshamFS/materials-simulation-skills★ 69same name
- nahid-sparktales/agent-dispatcher★ 59same name
- VoDaiLocz/kilo-kit-mcp★ 27same name
- Sir-chawakorn/sanook-cli★ 9same name
- xfstudio/skills★ 9same name
- roanbrasil/engineer-grade-agent-skills★ 8same name
- mehuldil/ai_sdlc_platform★ 4same name
- SKB3002/agenthub★ 4same name
6 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 repository61 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agent-deploymentSkill
- agent-designSkill
- agent-evaluationSkill
- agent-hardeningSkill
- agent-implementationSkill
- agent-observabilitySkill
- agent-scopingSkill
- api-designSkill
- code-templatingSkill
- dependency-upgradeSkill
- error-handlingSkill
- feature-implementationSkill
- project-scaffoldingSkill
- refactoringSkill
- data-analysisSkill
- data-migrationSkill
- data-modelingSkill
- sql-queriesSkill
- ci-pipelinesSkill
- containerizationSkill
- deployment-strategiesSkill
- infrastructure-as-codeSkill
- debuggingSkill
- issue-investigationSkill
- issue-triageSkill
- log-analysisSkill
- network-troubleshootingSkill
- api-documentationSkill
- commit-messagesSkill
- diagrammingSkill
- markdown-docsSkill
- plain-languageSkill
- pr-descriptionsSkill
- release-notesSkill
- browser-testingSkill
- integration-testingSkill
- load-testingSkill
- test-dataSkill
- test-driven-developmentSkill
- unit-testingSkill
- deep-researchSkill
- feed-digestSkill
- summarizationSkill
- accessibility-reviewSkill
- code-analysisSkill
- code-lintingSkill
- code-reviewSkill
- auth-designSkill
- dependency-auditSkill
- secrets-managementSkill
- security-analysisSkill
- threat-modelingSkill
- capacity-planningSkill
- disaster-recoverySkill
- incident-responseSkill
- monitoring-setupSkill
- root-cause-analysisSkill
- runbooksSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
7 rules. 0 are common, 7 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 9 edited versions we read keep these.
7
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Measure, change one thing, measure again: Every step below serves that loop.
- Distinctive: line 35
If it only happens in production, use tracing and sampling profilers there rather than guessing locally.
- Distinctive: line 42
Run an actual profiler. Do not read the code looking for something that seems expensive.
- Distinctive: line 49
Look for the shape of the problem, not just the top entry: a function taking 40% of the time matters, but so does one called 40,000 times …
- Distinctive: line 60
A missing index: check the query plan for a sequential scan on a large table.
- Distinctive: line 86
Run it several times, a single measurement is mostly noise.
- Distinctive: line 89
Check the tail, not just the median.
“Common” is measured: kept by at least 6 in 10 of the 9 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 profiling
Programmer intuition about performance is famously unreliable. The bottleneck is almost never where it feels like it should be, and the time spent optimising the wrong thing is doubly wasted — it costs the work and it adds complexity that makes the real fix harder.
Measure, change one thing, measure again. Every step below serves that loop.
1. Define slow, numerically
"Slow" is not actionable. Establish:
- What operation, measured where — server time, wall clock, time to first byte, time to interactive? These give different answers and different fixes.
- The current number, at a percentile. Use p95 or p99, not the mean. Averages hide the users who are actually suffering, and a mean that looks fine routinely conceals a tail that is ten times worse.
- The target, and why that number. "Under 200ms because it blocks a keystroke" is a target; "faster" is not.
Done when: you have a metric, a current percentile value, and a target.
2. Reproduce it under measurement
Find a way to trigger it repeatedly while you can observe it. Production-like data volume matters more than production-like hardware — most performance problems are algorithmic and only appear at scale, so a 100-row test table will show you nothing.
If it only happens in production, use tracing and sampling profilers there rather than guessing locally.
Done when: you can trigger the slow path on demand with realistic data.
3. Profile before forming a theory
Run an actual profiler. Do not read the code looking for something that seems expensive.
- CPU-bound: sampling profiler, then read the flame graph from the widest frame down
- I/O or network-bound: distributed tracing, or log timings around each external call
- Memory: heap profile and allocation counts, not just peak usage
- Database:
EXPLAIN ANALYZEthe actual query with real parameters
Look for the shape of the problem, not just the top entry: a function taking 40% of the time matters, but so does one called 40,000 times when it should be called once.
Done when: you can name where the time actually goes, with numbers.
4. Recognise the usual suspects
Most real-world slowness is one of a handful of things, and they are worth checking directly:
- N+1 queries: the single most common cause in application code. One query per row in a loop. Look for a database call inside an iteration.
- A missing index: check the query plan for a sequential scan on a large table.
- Work repeated per item that could be done once: a config parse, a compile, a connection.
- Serial calls that could be concurrent: five independent 200ms calls taking a second.
- Fetching far more data than is used:
SELECT *, unpaginated lists, over-broad joins. - Accidental O(n²): a nested loop, or a linear lookup inside an iteration that should be a hash.
Done when: you have a specific mechanism, not a suspicion.
5. Fix in order of leverage
- Do it less — cache, batch, deduplicate, avoid the work entirely. Nearly always the biggest win, and often the simplest.
- Do it in parallel — where the work is independent and the dependency can take it.
- Do it faster — better algorithm or data structure.
- Micro-optimise — last, rarely, and only with a profile proving it matters.
Change one thing, then re-measure. Two simultaneous optimisations mean you cannot tell which worked, and one of them may be making things worse.
Done when: each change has a measured before and after.
6. Confirm it is actually faster
- Measure the same percentile, the same way, with the same data. Comparing a warm run to a cold one proves nothing.
- Run it several times, a single measurement is mostly noise.
- Check you did not break correctness. Caching in particular trades correctness risk for speed; make sure the invalidation is right.
- Check the tail, not just the median. An optimisation that improves p50 and worsens p99 is usually a bad trade.
Done when: the improvement is reproducible and correctness is unchanged.
Report
Give the before and after numbers with their percentile and conditions, the mechanism you found, and what you changed. Note what you tried that did not help — that saves the next person repeating it. If you stopped short of the target, say what remains and what it would cost.
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.

