Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion crates/bencher_compat/src/compat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ impl Bencher {
black_box(inner());
}
self.codspeed.start_benchmark(uri.as_str());
black_box(inner());
let output = inner();
self.codspeed.end_benchmark();
black_box(output);
}
}

Expand Down
8 changes: 4 additions & 4 deletions crates/criterion_compat/src/compat/bencher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ impl<'a> Bencher<'a> {
for i in 0..codspeed::codspeed::WARMUP_RUNS + 1 {
let input = black_box(setup());
let output = if i < codspeed::codspeed::WARMUP_RUNS {
black_box(routine(input))
routine(input)
} else {
let input = black_box(setup());
codspeed.start_benchmark(self.uri.as_str());
let output = black_box(routine(input));
let output = routine(input);
codspeed.end_benchmark();
output
};
Expand Down Expand Up @@ -219,10 +219,10 @@ impl<'a, 'b, A: AsyncExecutor> AsyncBencher<'a, 'b, A> {
for i in 0..codspeed::codspeed::WARMUP_RUNS + 1 {
let input = black_box(setup());
let output = if i < codspeed::codspeed::WARMUP_RUNS {
black_box(routine(input).await)
routine(input).await
} else {
codspeed.start_benchmark(b.uri.as_str());
let output = black_box(routine(input).await);
let output = routine(input).await;
codspeed.end_benchmark();
output
};
Expand Down
6 changes: 4 additions & 2 deletions crates/divan_compat/src/compat/bench/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,9 @@ where
let mut gen_input = self.config.gen_input.borrow_mut();
let input = gen_input();
codspeed.start_benchmark(self.uri.as_str());
divan::black_box(benched(input));
let output = benched(input);
codspeed.end_benchmark();
divan::black_box(output);
}

pub fn bench_local_refs<O, B>(self, mut benched: B)
Expand All @@ -110,7 +111,8 @@ where
let mut input = gen_input();

codspeed.start_benchmark(self.uri.as_str());
divan::black_box(benched(&mut input));
let output = benched(&mut input);
codspeed.end_benchmark();
divan::black_box(output);
}
}