Benchmark methodology
The fairness rules and the gate are in
sbe/BENCHMARKS.md;
how a pair is built, its observation barriers and the A/A control in
sbe/benchmarks/methodology.md.
Two rules to keep in mind:
- Treat a surprising ratio as a benchmark defect until wire parity, equal work, optimizer opacity, amplified timing, both LTO profiles and instruction counts agree.
- Compare against your own previous release as well as against sbe-tool.
Two releases can both pass the sbe-tool ceiling while the second is slower.
just bench-ab <base> <branch>compares two commits on one host:
base
the base commit
the base commit
branch
the commit under test
the commit under test
base-rebuilt
the base commit plus a layout salt:
the A/A control
the base commit plus a layout salt:
the A/A control
The salt
an unused static and an unused
Bencher::iter, sorted before the
suite's own: the timed code starts
at other addresses. Each timed
symbol must move, and not by whole
cache lines (64 B x86, 128 B Apple).
No salt size moves them all: exit 4
an unused static and an unused
Bencher::iter, sorted before the
suite's own: the timed code starts
at other addresses. Each timed
symbol must move, and not by whole
cache lines (64 B x86, 128 B Apple).
No salt size moves them all: exit 4
base
base-rebuilt
branch
base-rebuilt
branch
base
branch
base
base-rebuilt
branch
base-rebuilt
base
base-rebuilt
base
branch
base
branch
base-rebuilt
within
spread of the base arm's per-round p50s
A/A
|p50(base-rebuilt) − p50(base)| / p50(base)
noise
max(within, A/A)
change
(p50(branch) − p50(base)) / p50(base)
UNSTABLE
A/A > 3 %: not judged either way, and not a pass
FAIL
change > noise and > the 1 % floor, or change > 3 %
PASS
otherwise
What it prints
n, min, p50, p99, p99.99 and max per arm, pooled over rounds
and repeats; then each row's verdict. Exit 1 on a FAIL, 3 when
only UNSTABLE rows remain, 2 on missing evidence.
Percentiles are of batch means (one Criterion sample's mean over a batch of
operations), not per-operation tails. Every max needs a cause before publishing.
n, min, p50, p99, p99.99 and max per arm, pooled over rounds
and repeats; then each row's verdict. Exit 1 on a FAIL, 3 when
only UNSTABLE rows remain, 2 on missing evidence.
Percentiles are of batch means (one Criterion sample's mean over a batch of
operations), not per-operation tails. Every max needs a cause before publishing.
Comparing two commits: three arms, rotated, with a layout salt
ergon book · Benchmark methodology (sbe/BENCHMARKS.md › Compare against your previous release)
Unchanged code moves when it is rebuilt, so the noise to beat is measured, not assumed.
built with
Rounds: each runs every arm once, in this order
1st
2nd
3rd
round 1
round 2
round 3
round 4
round 5
round 6
Rounds 1-3 rotate the order; 4-6 reverse it, so no arm runs twice in a row.
After 6 rounds every arm has run twice in each position and twice after each other arm.
--rounds must be a multiple of 3. Every run holds the bench lock and logs uptime.
The judge, per profile and scenario
Gate summary: Benchmarks.