Repository navigation
Releases: feresbr1/perfproof
Release list
perfproof 1.0.1
perfproof finds the lines that make your Node.js code slow, and proves whether a change made it faster, with a real statistical test instead of a hunch.
New in 1.0.1: GitHub Action
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- run: npm ci
- uses: feresbr1/perfproof@v1
with:
command: node scripts/build.js
setup: npm ci # prepares the base branch's checkoutEvery pull request is benchmarked against its base branch in the same job, and the job fails if it is significantly slower (Welch's t-test, p < 0.05 and at least 2%). The job summary shows both timings, the verdict and the pull request's hot lines. Example verdict from a test repository: SLOWER: takes 1.76× as long as the baseline (+75.7% time, p = 0.0016).
Inputs: command (required), base-ref, setup, runs, warmup, fail-if-slower, profile, working-directory.
Also available
- CLI:
npx github:feresbr1/perfproof run -- npm test/bench --save before/bench --compare before - Viewer: https://feresbr1.github.io/perfproof/
perfproof.mjsbelow is the whole CLI in one file (Node.js 22.15+).
perfproof 1.0.0
Find the slow line in Node.js, then prove the fix.
npx github:feresbr1/perfproof run -- npm test
npx github:feresbr1/perfproof bench --save before -- node build.js
# ...change the code...
npx github:feresbr1/perfproof bench --compare before -- node build.jsWhat's in 1.0.0
perfproof runprofiles a command and every Node.js process and worker thread it starts, then ranks the hot lines with their code, enclosing function and a hint for common slow patterns. It also reports hot functions (self and total time), CPU split by your code, dependencies, Node.js internals, native code and GC, and notes on heavy GC or I/O-bound runs.- Accurate lines: on-stack replacement is disabled while profiling, so a hot loop's time is no longer blamed on the line that called the function.
perfproof benchgives mean ± 95% CI, saved baselines, a Welch's t-test verdict (FASTER/SLOWER/NO SIGNIFICANT DIFFERENCE) and--fail-if-slower.perfproof analyzereports on existing.cpuprofilefiles.- Output as text, Markdown and JSON, plus a self-contained
flamegraph.htmlfor every run. - Agent skill:
npx skills add feresbr1/perfproof. - Web viewer: https://feresbr1.github.io/perfproof/ (nothing is uploaded).
Requires Node.js 22.15+. perfproof.mjs below is the whole CLI in one dependency-free file: node perfproof.mjs run -- <command>.