fix bench iter

This commit is contained in:
Nikolay Volf 2016-02-25 16:40:36 +03:00
parent f17d893f53
commit 5467b06c4f

View File

@ -33,7 +33,7 @@ use ethcore_util::uint::*;
fn u256_add(b: &mut Bencher) { fn u256_add(b: &mut Bencher) {
b.iter(|| { b.iter(|| {
let n = black_box(10000); let n = black_box(10000);
(0..n).fold(U256::from(1234599u64), |old, new| { old.overflowing_add(U256::from(new)).0 }) (0..n).fold(U256([12345u64, 0u64, 0u64, 0u64]), |old, new| { old.overflowing_add(U256::from(new)).0 })
}); });
} }
@ -42,7 +42,7 @@ fn u256_add(b: &mut Bencher) {
fn u256_sub(b: &mut Bencher) { fn u256_sub(b: &mut Bencher) {
b.iter(|| { b.iter(|| {
let n = black_box(10000); let n = black_box(10000);
(0..n).fold(U256::from(::std::u64::MAX), |old, new| { old.overflowing_sub(U256::from(new)).0 }) (0..n).fold(U256([::std::u64::MAX, 0u64, 0u64, 0u64]), |old, new| { old.overflowing_sub(U256::from(new)).0 })
}); });
} }