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();
|
||||
|
||||
bencher.iter(|| {
|
||||
// Since benchmarker runs this multiple times, we need to clear the signatures.
|
||||
bank.clear_signatures();
|
||||
|
||||
let results = bank.process_transactions(transactions.clone());
|
||||
assert!(results.iter().all(Result::is_ok));
|
||||
})
|
||||
bencher.iter_with_setup(
|
||||
|| {
|
||||
// Since benchmarker runs this multiple times, we need to clear the signatures.
|
||||
bank.clear_signatures();
|
||||
transactions.clone()
|
||||
},
|
||||
|transactions| {
|
||||
let results = bank.process_transactions(transactions);
|
||||
assert!(results.iter().all(Result::is_ok));
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
fn bench(criterion: &mut Criterion) {
|
||||
|
|
Loading…
Reference in New Issue