From 50501bb01ef1010551f90e8475ba7b13c3fd2756 Mon Sep 17 00:00:00 2001 From: Stephen Waits Date: Thu, 14 May 2026 11:27:12 -0600 Subject: [PATCH] test(bench): disable callgrind cache simulation in compare_profile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The profiling campaign ranks functions on instruction count (Ir) only, so callgrind's cache simulation is pure overhead — it roughly doubles each run's wall time. Pass `--cache-sim=no` via the gungraun `LibraryBenchmarkConfig` to halve the measure->optimize loop's latency. --- benches/compare_profile.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/benches/compare_profile.rs b/benches/compare_profile.rs index 0e48677..b1b4e13 100644 --- a/benches/compare_profile.rs +++ b/benches/compare_profile.rs @@ -22,6 +22,7 @@ use std::hint::black_box; +use gungraun::Callgrind; use gungraun::prelude::*; #[path = "../examples/_shared/compare_workload.rs"] @@ -37,4 +38,11 @@ library_benchmark_group!( benchmarks = full_compare_workload ); -main!(library_benchmark_groups = compare_group); +// `--cache-sim=no`: the campaign ranks functions on instruction count +// (`Ir`) only, so callgrind's cache simulation is pure overhead here — +// disabling it roughly halves each profiling run. +main!( + config = LibraryBenchmarkConfig::default() + .tool(Callgrind::with_args(["--cache-sim=no"])), + library_benchmark_groups = compare_group +);