Benchmark pow on BigUint (from #152)
This commit is contained in:
parent
fe513cc079
commit
71b2e0627c
|
@ -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);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue