benchgate

command
v0.5.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2026 License: Apache-2.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Command benchgate fails when benchmarks regressed. It reads the CSV output of `benchstat -format csv base.txt head.txt` on stdin, prints every regression, and exits 1 if there is one.

A benchmark regressed when benchstat calls the difference significant (the "vs base" column is a percentage, not "~") and the head is slower, or uses more memory or allocations, by more than -threshold percent. Requiring significance keeps noise on shared CI runners from failing pull requests; the threshold keeps tiny but real changes from doing so (0001 §8: 5%).

Below -fast-below per op (1 µs), time is gated at -fast-threshold (25%) instead: where the compiler and linker place a benchmark's code moves such a benchmark by up to ~15% with no change in what it runs (#413, #428, #422), because alignment and branch-predictor aliasing weigh on a few hundred nanoseconds. Their bytes and allocations per op keep -threshold: layout doesn't change those. docs/design/0001 §8 says how to tell a layout shift from a real regression.

Regressions are keyed by package, benchmark and unit. -flagged writes the keys found, one "pkg<TAB>benchmark<TAB>unit" line each. -confirm reads such a file from an earlier run and fails only on regressions that are in it as well, so a regression must show on two independent runs: real ones repeat, noise mostly does not.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL