Benchmark pow on BigUint (from #152)

This commit is contained in:
David Hewson 2016-01-06 17:02:21 +00:00 committed by Josh Stone
parent fe513cc079
commit 71b2e0627c
1 changed files with 13 additions and 0 deletions

View File

@ -188,3 +188,16 @@ fn hash(b: &mut Bencher) {
assert_eq!(h.len(), v.len());
});
}
#[bench]
fn pow_bench(b: &mut Bencher) {
b.iter(|| {
let upper = 250_usize;
for i in 2..upper + 1 {
for j in 2..upper + 1 {
let i_big = BigUint::from_usize(i).unwrap();
num::pow(i_big, j);
}
}
});
}