Benchcheck runs benchmarks on different versions of a Go module and compares statistics accross them, failing on performance regressions.
  • Go 97.1%
  • Makefile 2.9%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-08-29 20:24:06 +02:00
.github/workflows chore: add Go 1.19 to CI 2022-10-10 01:11:13 +02:00
cmd/benchcheck chore: use codeberg import paths. 2026-08-29 20:13:17 +02:00
internal/fake chore: use codeberg import paths. 2026-08-29 20:13:17 +02:00
.gitignore chore: add some fake coverage to fake functions 2022-04-18 18:49:13 +02:00
benchcheck.go feat: finish initial check implementation 2022-10-09 19:00:25 +02:00
benchcheck_integration_test.go chore: use codeberg import paths. 2026-08-29 20:13:17 +02:00
benchcheck_test.go chore: use codeberg import paths. 2026-08-29 20:13:17 +02:00
codecov.yml chore: remove threshold on coverage 2022-10-02 14:53:51 +02:00
go.mod chore: use codeberg import paths. 2026-08-29 20:13:17 +02:00
go.sum chore: use codeberg import paths. 2026-08-29 20:13:17 +02:00
LICENSE Initial commit 2021-08-21 15:47:52 +02:00
Makefile chore: add version flag back to make 2022-10-02 14:29:59 +02:00
README.md chore: use codeberg import paths. 2026-08-29 20:13:17 +02:00

benchcheck

benchcheck runs benchmarks on two different versions of a Go module and compares statistics across them, failing on performance regressions.

This tool aims at being Go specific and wildly simple, leveraging standard Go benchmarks + benchstat, composing them to provide just a few extra features:

  • Given two module versions of a package, it automatically benchmarks and compares them
  • Given a threshold on the delta of performance loss, the check fails (useful for CI's)

And that is it, no more, no less.

Dependencies

  • git
  • go

Install

Just run:

go install codeberg.org/madlambda/benchcheck/cmd/benchcheck@latest

Usage

For details just run:

benchcheck -help

By default all benchmarks are run with -benchmem, so you also have information on memory allocations.

Comparing performance between two versions of a Go module and just showing results on output (no check performed):

benchcheck cool.go.module v0.0.1 v0.0.2

Comparing performance between two versions of a Go module and failing on time regression:

benchcheck cool.go.module v0.0.1 v0.0.2 -time-delta +13.31%

Now doing the same but also checking for allocation regression:

benchcheck cool.go.module v0.0.1 v0.0.2 -alloc-delta +15% -allocs-delta +20%

You can also check if your code got faster and use the check to I don't know... Celebrate ? =P

benchcheck cool.go.module v0.0.1 v0.0.2 -time-delta -20%