Use iter_with_setup() to improve precision
This commit is contained in:
parent
cc89801b12
commit
d2be79f38c
|
@ -39,13 +39,17 @@ fn bench_process_transaction(bencher: &mut Bencher) {
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
bencher.iter(|| {
|
bencher.iter_with_setup(
|
||||||
// Since benchmarker runs this multiple times, we need to clear the signatures.
|
|| {
|
||||||
bank.clear_signatures();
|
// Since benchmarker runs this multiple times, we need to clear the signatures.
|
||||||
|
bank.clear_signatures();
|
||||||
let results = bank.process_transactions(transactions.clone());
|
transactions.clone()
|
||||||
assert!(results.iter().all(Result::is_ok));
|
},
|
||||||
})
|
|transactions| {
|
||||||
|
let results = bank.process_transactions(transactions);
|
||||||
|
assert!(results.iter().all(Result::is_ok));
|
||||||
|
},
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn bench(criterion: &mut Criterion) {
|
fn bench(criterion: &mut Criterion) {
|
||||||
|
|
Loading…
Reference in New Issue