Skip to content

perfproof 1.0.1

Latest

Choose a tag to compare

@feresbr1 feresbr1 released this 20 Oct 10:46
9d600a0

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 checkout

Every 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.mjs below is the whole CLI in one file (Node.js 22.15+).