perf-verifier
Skill1 starsChanged 41 days agoMITView on GitHub
Makes performance work evidence-based instead of guesswork. Use whenever the task is to make code faster or lighter (slow endpoint, query, script, build, page, memory use), and when writing code that loops over data, queries a database, calls APIs or handles large inputs. Profiles to find the real bottleneck, measures before/after with a statistical test, checks the output did not change, and shows how runtime grows with input size. Never claim a speedup without a measurement, even if the user only said "optimize this".
1 other project uses a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- David-Florian2013/perf-verifieredited, first seen Oct 20, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- David-Florian2013/perf-verifier★ 094% same
Wrote their own version · 0
None found.
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 repository5 other files it gives its agents.
- llms.txtllms.txt
- code-verifierSkill
- context-saverSkill
- prompt-clarifierSkill
- repo-mapSkill
The file
Files
Perf Verifier
Language models write code that is slower than expert code (about 3x the run time of reference solutions in one benchmark), and coding agents optimising real repositories fail in three documented ways: they optimise something that is not the bottleneck, they stop after the first patch that passes, and they do not test enough, so results change. Speedup claims are also unreliable: in a 30-run study with a Mann-Whitney test, only about 6% of solutions labelled "faster" were measurably faster. This skill gives you numbers to act on instead of a feeling.
PF means python3 <this skill's directory>/scripts/pf.py. It needs only Python 3 (Linux or macOS). --cmd takes the command as one quoted string; everything after a bare -- is also read as the command.
Workflow
- Is it slow?
PF bench --cmd 'python3 job.py 5000'gives median time and peak memory. Pick an input of realistic size; a command under 30 ms measures process start-up, not your code. - Where does the time go?
PF profile -- python3 job.py 5000(Python or Node commands). Rows marked*are your code. Work on the top*row. Theceilingline says the most the whole run can speed up if that function became free: if the ceiling is smaller than the speedup you need, the bottleneck is elsewhere or the algorithm must change. - Prefer the algorithm.
PF scanlists slow patterns in the lines you changed (query or request inside a loop, list used for membership,awaitin a loop, copying an accumulator, blocking calls in async code, and more). Treat each finding as a hypothesis: act on it only if it sits on the profiled hot path. Findings are about patterns and cannot know the size of your data. - Check how it scales.
PF scale --sizes 2000,4000,8000,16000 --cmd 'python3 job.py {N}'fits time against input size and names the growth (linear, about quadratic, ...). A change that only helps at one size can be a measurement artefact; a quadratic that became linear is real. - Prove the change. After editing, with the old version still in git:
PF check --cmd 'python3 job.py 5000' --expect faster --verify '<the project test command>'. It runs the committed version and your working tree alternately, tests the difference, compares the program output, and runs the test command. Use--base <ref>to compare against another commit, or--a 'old command' --b 'new command'to compare two implementations without git. - Do not stop at the first win. Profile again. Stop when the top ceiling is under about 1.1x or the target is met.
- Report. Print the
SUMMARY:line from step 5 as the last line of your reply. If you measured nothing, say so in one sentence.
Reading the verdict
FASTER/SLOWER: the difference passed the test (p < 0.05) and exceeded the measured noise. OnlyFASTERsupports saying "faster".NO MEASURABLE DIFFERENCE: the change did nothing you can show. Say that, and consider reverting if the new code is more complex.OUTPUT DIFFERENT: the two versions print different results. This is a failure, not a speedup.nondeterministicmeans output varies between runs of the same code, so equality was not verified; use--verifywith real tests.NOT PROVEN(with--expect faster) andUNMEASUREDmean no claim of speedup is allowed.- A command that fails or times out cannot be timed; fix it first.
Things to know
- The before-version is the committed files only. If the command needs untracked data or generated files, pass
--link path(repeatable) so they are linked into the before-copy.node_modules,.venv,venvare linked automatically. comparetakes about a minute at most (--budgetseconds,--runsto fix the count). Few runs means low power and the output says so.profilesupportspython/nodecommands only; for other stacks use that stack's profiler and still usecompareandscale, which work with any command.- To silence a scan finding that is a false positive:
# pf: ignore RULE-CODE(or// pf: ignore RULE-CODE) on the line or the line above. - Memory:
bench,compareandscalereport peak memory of the command; a speedup bought with much more memory is worth stating.
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.

