A benchmark is a measurement system. It can report a precise number while measuring removed work, an unstable sample, or an uncontrolled machine. This talk argues you should trust a Go benchmark only after answering three questions: Is the compiler measuring real work? Is the sample stable enough? Is the difference large relative to the noise?
We work through three layers. Compiler honesty covers dead-code elimination, sinks, constant folding, inlining, timer ordering, and the B.Loop construct that fixes the non-terminating-timer case. Statistical interpretation covers repeated samples, benchstat, coefficient of variation, run-count discipline, and the p-hacking traps that inflate false positives. Environment control covers both local machines and CI: Linux frequency and isolation controls, perflock, benchdiff, and the bare-metal runners that shared CI instances are not.
A war story from dd-trace-go ties the layers together. A benchmark measured code the PR did not touch, the same-machine result reversed the CI sign, and code layout explained the small shift that made the result directionally wrong. The repository ships the tools and captured outputs that turn those lessons into repeatable checks.
Links
- gopherconuk-26 — slides, speaker notes, demo results, and the
honestbench,benchgate, andbenchenvCLIs - benchlab
Events
- GopherCon UK 2026 — Wednesday 12 August 2026, 15:15, The Google Track
Related
- Measuring Software Performance: Why Your Benchmarks Are Probably Lying — full technical blog post expanding on this talk