Skip to main content

compare

Attribute Macro compare 

Source
#[compare]
Expand description

Define a comparison group for multiple benchmarks

§Example

#[flux::compare(
    id = "parser_showdown",
    title = "JSON Parser Comparison",
    benchmarks = ["bench_serde", "bench_simd_json", "bench_sonic", "bench_jiter", "bench_yyjson"],
    baseline = "bench_serde",
    metric = "mean"
)]
struct ParserComparison;

This creates a comparison group that will:

  • Display all benchmarks in a comparison table
  • Compute speedup ratios vs the baseline
  • Generate data for comparison charts