Expand bigint shl/shr benchmarking
This commit is contained in:
parent
494fce7dd3
commit
1ebcc77513
|
@ -168,12 +168,23 @@ fn from_str_radix_36(b: &mut Bencher) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[bench]
|
#[bench]
|
||||||
fn shr(b: &mut Bencher) {
|
fn shl(b: &mut Bencher) {
|
||||||
let n = { let one : BigUint = One::one(); one << 1000 };
|
let n = BigUint::one() << 1000;
|
||||||
b.iter(|| {
|
b.iter(|| {
|
||||||
let mut m = n.clone();
|
let mut m = n.clone();
|
||||||
for _ in 0..10 {
|
for i in 0..50 {
|
||||||
m = m >> 1;
|
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;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue