summaryrefslogtreecommitdiffstats
path: root/library/core/benches/num/flt2dec/strategy/dragon.rs
diff options
context:
space:
mode:
Diffstat (limited to 'library/core/benches/num/flt2dec/strategy/dragon.rs')
-rw-r--r--library/core/benches/num/flt2dec/strategy/dragon.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/library/core/benches/num/flt2dec/strategy/dragon.rs b/library/core/benches/num/flt2dec/strategy/dragon.rs
index 319b9773e..377c99eff 100644
--- a/library/core/benches/num/flt2dec/strategy/dragon.rs
+++ b/library/core/benches/num/flt2dec/strategy/dragon.rs
@@ -1,14 +1,14 @@
use super::super::*;
use core::num::flt2dec::strategy::dragon::*;
use std::mem::MaybeUninit;
-use test::Bencher;
+use test::{black_box, Bencher};
#[bench]
fn bench_small_shortest(b: &mut Bencher) {
let decoded = decode_finite(3.141592f64);
let mut buf = [MaybeUninit::new(0); MAX_SIG_DIGITS];
b.iter(|| {
- format_shortest(&decoded, &mut buf);
+ format_shortest(black_box(&decoded), &mut buf);
});
}
@@ -17,7 +17,7 @@ fn bench_big_shortest(b: &mut Bencher) {
let decoded = decode_finite(f64::MAX);
let mut buf = [MaybeUninit::new(0); MAX_SIG_DIGITS];
b.iter(|| {
- format_shortest(&decoded, &mut buf);
+ format_shortest(black_box(&decoded), &mut buf);
});
}
@@ -26,7 +26,7 @@ fn bench_small_exact_3(b: &mut Bencher) {
let decoded = decode_finite(3.141592f64);
let mut buf = [MaybeUninit::new(0); 3];
b.iter(|| {
- format_exact(&decoded, &mut buf, i16::MIN);
+ format_exact(black_box(&decoded), &mut buf, i16::MIN);
});
}
@@ -35,7 +35,7 @@ fn bench_big_exact_3(b: &mut Bencher) {
let decoded = decode_finite(f64::MAX);
let mut buf = [MaybeUninit::new(0); 3];
b.iter(|| {
- format_exact(&decoded, &mut buf, i16::MIN);
+ format_exact(black_box(&decoded), &mut buf, i16::MIN);
});
}
@@ -44,7 +44,7 @@ fn bench_small_exact_12(b: &mut Bencher) {
let decoded = decode_finite(3.141592f64);
let mut buf = [MaybeUninit::new(0); 12];
b.iter(|| {
- format_exact(&decoded, &mut buf, i16::MIN);
+ format_exact(black_box(&decoded), &mut buf, i16::MIN);
});
}
@@ -53,7 +53,7 @@ fn bench_big_exact_12(b: &mut Bencher) {
let decoded = decode_finite(f64::MAX);
let mut buf = [MaybeUninit::new(0); 12];
b.iter(|| {
- format_exact(&decoded, &mut buf, i16::MIN);
+ format_exact(black_box(&decoded), &mut buf, i16::MIN);
});
}
@@ -62,7 +62,7 @@ fn bench_small_exact_inf(b: &mut Bencher) {
let decoded = decode_finite(3.141592f64);
let mut buf = [MaybeUninit::new(0); 1024];
b.iter(|| {
- format_exact(&decoded, &mut buf, i16::MIN);
+ format_exact(black_box(&decoded), &mut buf, i16::MIN);
});
}
@@ -71,6 +71,6 @@ fn bench_big_exact_inf(b: &mut Bencher) {
let decoded = decode_finite(f64::MAX);
let mut buf = [MaybeUninit::new(0); 1024];
b.iter(|| {
- format_exact(&decoded, &mut buf, i16::MIN);
+ format_exact(black_box(&decoded), &mut buf, i16::MIN);
});
}