Make slot history a billion times faster (#10175)

This commit is contained in:
sakridge
2020-05-22 11:15:16 -07:00
committed by GitHub
parent b7a32f01c0
commit 2324eb9ff9
2 changed files with 134 additions and 4 deletions

View File

@ -13,3 +13,16 @@ fn bench_to_from_account(b: &mut Bencher) {
slot_history = SlotHistory::from_account(&account).unwrap();
});
}
#[bench]
fn bench_slot_history_add_new(b: &mut Bencher) {
let mut slot_history = SlotHistory::default();
let mut slot = 0;
b.iter(|| {
for _ in 0..5 {
slot_history.add(slot);
slot += 100000;
}
});
}