Status cache improvements (#16174)

This commit is contained in:
sakridge
2021-03-28 19:10:14 -07:00
committed by GitHub
parent 27ab415ecc
commit 5e5b63712b
3 changed files with 130 additions and 127 deletions

View File

@ -10,13 +10,13 @@ use solana_sdk::{
};
use test::Bencher;
type BankStatusCache = StatusCache<()>;
type BankStatusCache = StatusCache<Signature, ()>;
#[bench]
fn test_statuscache_serialize(bencher: &mut Bencher) {
let mut status_cache = BankStatusCache::default();
status_cache.add_root(0);
status_cache.clear_signatures();
status_cache.clear();
for hash_index in 0..100 {
let blockhash = Hash::new(&vec![hash_index; std::mem::size_of::<Hash>()]);
let mut id = blockhash;