Skip to main content

bench_group

Macro bench_group 

Source
macro_rules! bench_group {
    (name = $name:ident; config = $config:expr; targets = $($target:path),+ $(,)?) => { ... };
    ($name:ident, $($target:path),+ $(,)?) => { ... };
}
Expand description

Defines a Criterion benchmark group for benchmarks annotated with gpui::bench.

This mirrors criterion::criterion_group!, but the group measures with the gpui::BenchMeasurement configured by BENCH_MEASUREMENT (see BenchMeasurement::from_env). By default Criterion analyzes wall time while retired instructions, cycles, IPC, context switches, and the other counters this machine supports are printed per iteration in the GPUI bench report. BENCH_MEASUREMENT=instructions makes Criterion analyze process-wide instructions instead, foreground-instructions the benchmark thread’s alone, and wall-time disables all counters. A config = ... expression may set any other Criterion option; its measurement is replaced. To measure with something else, call criterion::criterion_group! directly with config = criterion::Criterion::default().with_measurement(gpui::BenchMeasurement::new(...)).