agentleFS
David-Florian2013David-Florian2013/perf-verifier/SKILL.md

perf-verifier

Skill0 starsChanged 29 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

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    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 repositoryOne other file it gives its agents.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    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
  1. Distinctive:

    Do not call code faster without a measurement.

    line 8

≈ “Common” is an estimate: at least 1 in 5 of the 372,429 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Perf Verifier

Do not call code faster without a measurement. Profile first, compare the old command with the new one, and check the output did not change. If nothing was measured, say so. A scan finding is a hypothesis, not a speedup.

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

  1. 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.
  2. 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. The ceiling line 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.
  3. Prefer the algorithm. PF scan lists slow patterns in the lines you changed (query or request inside a loop, list used for membership, await in 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.
  4. 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.
  5. 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.
  6. Do not stop at the first win. Profile again. Stop when the top ceiling is under about 1.1x or the target is met.
  7. 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. Only FASTER supports 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. nondeterministic means output varies between runs of the same code, so equality was not verified; use --verify with real tests.
  • NOT PROVEN (with --expect faster) and UNMEASURED mean 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, venv are linked automatically.
  • compare takes about a minute at most (--budget seconds, --runs to fix the count). Few runs means low power and the output says so.
  • profile supports python/node commands only; for other stacks use that stack's profiler and still use compare and scale, 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, compare and scale report peak memory of the command; a speedup bought with much more memory is worth stating.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.