Skip to main content

compare_summaries

Function compare_summaries 

Source
pub fn compare_summaries(
    reference: &[BenchmarkSummary],
    candidate: &[BenchmarkSummary],
    minimum_tolerance: f64,
) -> Result<BenchmarkVerdict, ParseBenchesError>
Expand description

Compare at least three repeated reference and candidate summaries.

Every summary must name the executables its pass ran. Each side’s passes must all have run the same executables, and no executable path may appear on both sides: a shared path means the two revisions were measured with the same binary.

The tolerance is three times the larger side’s median absolute deviation, with minimum_tolerance as a floor. A benchmark fails only when its median ratio exceeds that tolerance and every candidate pass is also slower than every reference pass: with a handful of passes per side, a median shift inside the two sides’ overlapping ranges is run-to-run noise, not a regression. Bilateral all-zero samples are tied below bencher’s integer-nanosecond resolution. Other missing, non-finite, or non-positive samples are errors and therefore cannot silently pass.

§Errors

Returns ParseBenchesError for too few samples, mismatched benchmark sets, missing, drifting or shared executables, or invalid measurements.