perf-measure-first
Skill0 starsChanged 2 months agoMITView on GitHub
Use when optimizing latency, throughput, memory, or bundle size. Profile or benchmark before changing code; record before/after numbers so gains are real and regressions are caught.
In this repository9 other files it gives its agents.
- adversarial-reviewSkill
- api-compatSkill
- flaky-test-triageSkill
- incident-hotfixSkill
- repro-firstSkill
- secrets-hygieneSkill
- skill-authorSkill
- test-plan-firstSkill
- yagni-sliceSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
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
- could be automatic: a setting could enforce it
- Distinctive: line 27
Do not change production autoscaling, drop traffic, or alter live configs without confirmation.
- Distinctive: line 28
Do not commit large binary profiles or secrets from prod dumps without scrubbing and approval.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Perf Measure First
When to use
- The user asks to "make it faster", "reduce memory", or "optimize" a path.
- A performance regression is suspected after a change.
- You are about to rewrite hot code based on intuition alone.
When not to use
- Correctness bugs with no performance claim (fix first; optimize later).
- Micro-edits with no measurable user or system impact expected.
- Premature optimization on cold paths identified as non-critical.
Assumptions
- Ability to run a profiler, benchmark harness, or representative workload (e.g.
hyperfine, language benchmarks, browser perf tools,clinic,pprof). - A stable environment for comparison (same machine/flags when possible).
- Do not change production autoscaling, drop traffic, or alter live configs without confirmation.
- Do not commit large binary profiles or secrets from prod dumps without scrubbing and approval.
Workflow
- Define the metric and success threshold (p95 latency, ops/sec, RSS, bundle KB).
- Establish a reproducible benchmark or profile scenario.
- Record a baseline (before) with command, environment, and numbers.
- Change one hypothesized bottleneck at a time.
- Record after; keep the change only if the metric improves without breaking tests.
Steps
- Metric lock — Pick one primary metric and how it is measured. Avoid optimizing "feel" without numbers.
- Scenario — Use production-like inputs/sizes; document dataset and command line.
- Baseline — Run ≥3 iterations when noisy; save raw output or a short table in the PR.
- Hypothesis — Name the suspected hotspot from the profile (function, query, alloc site) before editing.
- Single-axis change — One optimization per experiment so attribution is clear.
- Compare & guard — After numbers win, run functional tests; watch for accuracy/complexity regressions.
Success criteria
- Baseline numbers exist before optimization commits.
- After numbers use the same scenario/commands and show a clear delta.
- Changes map to a profile/benchmark-backed hypothesis.
- Functional tests still pass; no silent correctness tradeoff unless approved.
- Production-impacting knobs were confirmed or left untouched.
Out of scope
- Capacity planning and cluster-wide cost modeling.
- UX redesign unrelated to measured performance.
- Replacing the entire stack for a micro-gain without a business case.
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.

