fix bench iter
This commit is contained in:
parent
f17d893f53
commit
5467b06c4f
@ -33,7 +33,7 @@ use ethcore_util::uint::*;
|
||||
fn u256_add(b: &mut Bencher) {
|
||||
b.iter(|| {
|
||||
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) {
|
||||
b.iter(|| {
|
||||
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 })
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user