
Your Benchmarks Are Lying to You (And This 148-Star Crate Knows Why)
Microbenchmarks lie. Not maliciously, just structurally. You write a tight loop, measure it a thousand times, compare two implementations, and declare a winner. Except your CPU was thermally throttling during the second run. Or the OS decided to schedule a background process halfway through your baseline. Or the memory allocator fragmented differently between runs because you ate lunch and came back. Most benchmarking harnesses deal with this by collecting more samples and hoping statistics will save you. Run it ten thousand times instead of a thousand. Throw out outliers. Compute confidence intervals. It helps, but it's patching over a fundamental problem: you measured the baseline and the candidate at different times, under different system conditions. What if you didn't have to? What Is Tango? Tango is a Rust microbenchmarking harness built by Denis Bazhenov around a simple idea: run baseline and candidate together. Not sequentially. Interleaved. Baseline, candidate, baseline, candi
Continue reading on Dev.to
Opens in a new tab



