runtime: Add bench for accounts::hash_internal_state (#5157)
* runtime: Add bench for accounts::hash_internal_state * fixup! cargo fmt * fixup! cargo clippy * fixup! Use a more representitive number of accounts * fixup! More descriptive name for accounts creation helper
This commit is contained in:
@ -2,6 +2,7 @@
|
||||
|
||||
extern crate test;
|
||||
|
||||
use solana_runtime::accounts::{create_test_accounts, Accounts};
|
||||
use solana_runtime::bank::*;
|
||||
use solana_sdk::account::Account;
|
||||
use solana_sdk::genesis_block::create_genesis_block;
|
||||
@ -56,3 +57,13 @@ fn test_accounts_squash(bencher: &mut Bencher) {
|
||||
banks[1].squash();
|
||||
});
|
||||
}
|
||||
|
||||
#[bench]
|
||||
fn test_accounts_hash_internal_state(bencher: &mut Bencher) {
|
||||
let accounts = Accounts::new(Some("bench_accounts_hash_internal".to_string()));
|
||||
let mut pubkeys: Vec<Pubkey> = vec![];
|
||||
create_test_accounts(&accounts, &mut pubkeys, 60000);
|
||||
bencher.iter(|| {
|
||||
accounts.hash_internal_state(0);
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user