performance-investigation
Skill98 starsChanged 2 months agoMITView on GitHub
Measurement-first performance work — baseline, profile, fix by leverage (do less work → cache → parallelize → tune constants), verify with the same measurement. Use for any "make it faster", "why is this slow", latency/memory/CPU investigation, timeout or p95 regression, or before adding caching, memoization, indexes or parallelism on intuition. Not for reviewing new code for complexity-class mistakes (see perf-sanity).
9 other projects use a version of this.
Adopted by
Most recently taken up by
- cormacc/dotagentstheir own version, first seen Nov 8, 2026
- REPOZY/superpowers-optimizedtheir own version, first seen Nov 8, 2026
- ericwang200608-beep/LANYANT-Skillstheir own version, first seen Nov 8, 2026
- itsofficialadi/boundifftheir own version, first seen Oct 25, 2026
- iamHrithikRaj/loomtheir own version, first seen Oct 20, 2026
- sveltejs/sveltetheir own version, first seen Oct 8, 2026
Used with
Projects with it also use security-review.
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.
SentrySkillsecurity-review
Finds exploitable application security vulnerabilities in code changes. Use for Warden security scans, appsec review, OWASP-style checks, authentication or authorization bugs, injection, XSS, SSRF, path traversal, secrets, unsafe crypto, webhook verification, open redirects, or sensitive data exposure.
Also in 3 projects that use this
Other versions9 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 9
- sveltejs/svelte★ 89ksame name
- microsoft/sre-agent★ 187same name
- REPOZY/superpowers-optimized★ 146same name
- ericwang200608-beep/LANYANT-Skills★ 2same name
- cormacc/dotagents★ 1same name
- motao123/dev-workflow-kit★ 1same name
- gclm/super-stack★ 0same name
- iamHrithikRaj/loom★ 0same name
- itsofficialadi/boundiff★ 0same name
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 repository38 other files it gives its agents.
- ambiguity-commitSkill
- api-surface-careSkill
- calibrated-recommendationSkill
- codebase-orientationSkill
- concurrency-reasoningSkill
- config-and-flagsSkill
- context-checkpointSkill
- cross-platform-careSkill
- data-loss-guardSkill
- data-migration-safetySkill
- dependency-changesSkill
- docs-as-contractSkill
- edge-case-sweepSkill
- environment-firstSkill
- error-message-qualitySkill
- escalate-vs-decideSkill
- estimation-and-scopingSkill
- explain-at-the-right-levelSkill
- generalize-the-correctionSkill
- git-hygieneSkill
- incident-diagnosisSkill
- leave-no-messSkill
- llm-app-codeSkill
- numerical-careSkill
- perf-sanitySkill
- question-vs-taskSkill
- resource-lifecycleSkill
- reviewing-a-changeSkill
- root-cause-debuggingSkill
- security-reflexesSkill
- stop-thrashingSkill
- subagent-fanoutSkill
- surgical-refactoringSkill
- task-decompositionSkill
- test-designSkill
- untrusted-content-guardSkill
- verify-ui-visuallySkill
- workmanshipSkill
The file
We split this skill into the rules it gives an agent
1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.
0
Common
Most of the 8 edited versions we read keep these.
1
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 18
If the baseline already meets the target, report that and stop.
“Common” is measured: kept by at least 6 in 10 of the 8 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 Investigation
Weak performance work looks like: read the code → spot something that "looks slow" → add a cache or parallelise it → declare it faster. Strong performance work is a measurement loop: nothing is edited until a number exists, and nothing is called an improvement until the same number moves. Do not skip stages.
1. Define the metric and record the baseline
Pick ONE number that captures the complaint: p95 latency of endpoint X, wall time of job Y, MB of heap after Z. Write down the exact command that measures it and run it at least 5 times on the same input; record median and spread. If the spread is larger than the improvement you expect, fix the measurement first (warm-up runs, prod build, bigger input, quieter machine) — a noisy baseline proves nothing either way.
Measure on an input representative of the complaint, not the test fixture: a 10-row run says nothing about 100k rows. Where cheap, also run at 10× the input — how the time grows (linear, quadratic) locates the problem faster than any profiler.
Beware benchmark lies: cold vs warm caches, dev-mode builds, first-iteration JIT/warm-up, laptop-vs-prod hardware, and a metric that doesn't match the complaint (CPU time when the user feels wall time).
If the baseline already meets the target, report that and stop.
2. Find where the time goes — waiting or working?
First split wall time from CPU time (time, a timer around the call, request duration vs CPU). Wall ≫ CPU means the process is waiting — on a query, a network call, a lock, a disk — and a CPU profiler will show nothing useful; use query logs + EXPLAIN, traces, or timestamps around each I/O call. Wall ≈ CPU means compute: CPU profiler or flamegraph. Memory complaints get a heap snapshot or allocation profile.
The bottleneck is a measurement result, not an opinion: name the frame, query, or call and the share of time it accounts for. Expect one or two items to dominate. A flat profile usually means per-item overhead in a loop (allocation, serialization, sync I/O) or doing N× more work than the task needs.
3. Fix in order of leverage, one change at a time
- Do less work — N+1 queries → batch/join; O(n²) scan → index/map lookup; recomputing invariants inside loops → hoist; fetching/serializing fields nobody reads → trim.
- Do work once — cache/memoize, only with a written invalidation story; a stale cache is a correctness bug traded for speed.
- Do work elsewhere/later — off the critical path: lazy, background, stream the first byte early.
- Do work in parallel — after the above; a parallelised N+1 is still N+1.
- Tune constants last — micro-optimisations only with a profiler receipt that the line is hot.
Apply one change, rerun the stage-1 command, record the number. If it didn't move, revert that change before trying the next — never keep an "optimisation" that bought nothing, and never stack two unmeasured changes.
4. Verify with the SAME measurement, then check for damage
Rerun the exact baseline command under the same conditions. Then run the correctness suite — perf fixes break edge cases (stale cached data, reordered side effects, errors swallowed in parallel code).
Bottleneck signatures (check before deep-diving)
- Latency scales with item count → N+1 (queries, HTTP calls, file reads per item).
- Slow only in prod → missing index at prod data volume, cold cache, network hops dev lacks.
- Grows over time → leak (unbounded cache/listener/array), fragmentation, log growth.
- Occasional spikes → GC pauses, lock contention, batch jobs sharing resources, retry storms.
- "Fast function, slow system" → serialization at boundaries, chatty protocols, sync-over-async.
Report
When the deliverable is a findings list or a plan rather than a fix you measured, the measurement is the first item: name the baseline you would take (which request, which metric, which command) and say the same measurement is re-run after each change. Order the findings by their measured or estimated share of the cost and say how you attributed it (which instrument, or which arithmetic); mark any attribution you could not make from the material as unverified. Name which proposed fixes are constant-tuning or caching that you would defer until the underlying work is reduced.
Include: the measurement command; baseline and final numbers with units, run count, spread and conditions ("p95 420ms → 95ms, median of 5, warm, prod build, dataset X"); what the profile showed; each change tried with its measured effect, including reverted ones; and the trade made — readability, memory, or freshness for speed. If the target is not met, say what remains and where the remaining time goes.
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.

