Simplify benchmark setup; support mutating machine

This commit is contained in:
infogulch
2023-11-13 14:58:18 -06:00
parent 3b7d4a7b36
commit 40608dc8d4
4 changed files with 98 additions and 122 deletions

View File

@@ -3,15 +3,15 @@ use iai_callgrind::{library_benchmark, library_benchmark_group, main};
mod setup;
#[library_benchmark]
#[bench::normal(setup::benches())]
fn bench_edges(mut b: setup::Benches) {
b.run_once("count_edges_short");
#[bench::normal(setup::prolog_benches()["count_edges_short"].setup())]
fn bench_edges(mut run: impl FnMut()) {
run();
}
#[library_benchmark]
#[bench::normal(setup::benches())]
fn bench_numlist(mut b: setup::Benches) {
b.run_once("numlist_short");
#[bench::normal(setup::prolog_benches()["numlist_short"].setup())]
fn bench_numlist(mut run: impl FnMut()) {
run();
}
library_benchmark_group!(