Repository navigation
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+).