Skip to content

Commit d842f23

Browse files
DaniPopesart049
authored andcommitted
chore: remove unnecessary black_box in criterion
The original code only uses black_box when dropping, not inside of the measurement.
1 parent 6178dd1 commit d842f23

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

crates/criterion_compat/src/compat/bencher.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ impl<'a> Bencher<'a> {
6767
for i in 0..codspeed::codspeed::WARMUP_RUNS + 1 {
6868
let input = black_box(setup());
6969
let output = if i < codspeed::codspeed::WARMUP_RUNS {
70-
black_box(routine(input))
70+
routine(input)
7171
} else {
7272
let input = black_box(setup());
7373
codspeed.start_benchmark(self.uri.as_str());
74-
let output = black_box(routine(input));
74+
let output = routine(input);
7575
codspeed.end_benchmark();
7676
output
7777
};
@@ -219,10 +219,10 @@ impl<'a, 'b, A: AsyncExecutor> AsyncBencher<'a, 'b, A> {
219219
for i in 0..codspeed::codspeed::WARMUP_RUNS + 1 {
220220
let input = black_box(setup());
221221
let output = if i < codspeed::codspeed::WARMUP_RUNS {
222-
black_box(routine(input).await)
222+
routine(input).await
223223
} else {
224224
codspeed.start_benchmark(b.uri.as_str());
225-
let output = black_box(routine(input).await);
225+
let output = routine(input).await;
226226
codspeed.end_benchmark();
227227
output
228228
};

0 commit comments

Comments
 (0)