From 1ebcc7751364148ffc8bd2846d84714d9a4f5488 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 27 Jan 2016 22:53:10 -0800 Subject: [PATCH] Expand bigint shl/shr benchmarking --- benches/bigint.rs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/benches/bigint.rs b/benches/bigint.rs index 055f905..3635387 100644 --- a/benches/bigint.rs +++ b/benches/bigint.rs @@ -168,12 +168,23 @@ fn from_str_radix_36(b: &mut Bencher) { } #[bench] -fn shr(b: &mut Bencher) { - let n = { let one : BigUint = One::one(); one << 1000 }; +fn shl(b: &mut Bencher) { + let n = BigUint::one() << 1000; b.iter(|| { let mut m = n.clone(); - for _ in 0..10 { - m = m >> 1; + for i in 0..50 { + m = m << i; + } + }) +} + +#[bench] +fn shr(b: &mut Bencher) { + let n = BigUint::one() << 2000; + b.iter(|| { + let mut m = n.clone(); + for i in 0..50 { + m = m >> i; } }) }