Make slot history a billion times faster (#10175)
This commit is contained in:
@ -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;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user