Use option for account index bucket parameter (#19150)

This commit is contained in:
Jeff Washington (jwash)
2021-08-10 11:32:25 -05:00
committed by GitHub
parent 8557dac51d
commit 651343688d
12 changed files with 33 additions and 32 deletions

View File

@@ -5,7 +5,7 @@ extern crate test;
use rand::{thread_rng, Rng};
use solana_runtime::{
accounts_db::AccountInfo,
accounts_index::{AccountSecondaryIndexes, AccountsIndex, BINS_DEFAULT},
accounts_index::{AccountSecondaryIndexes, AccountsIndex, BINS_FOR_BENCHMARKS},
};
use solana_sdk::pubkey::{self, Pubkey};
use test::Bencher;
@@ -18,7 +18,7 @@ fn bench_accounts_index(bencher: &mut Bencher) {
const NUM_FORKS: u64 = 16;
let mut reclaims = vec![];
let index = AccountsIndex::<AccountInfo>::new(BINS_DEFAULT);
let index = AccountsIndex::<AccountInfo>::new(Some(BINS_FOR_BENCHMARKS));
for f in 0..NUM_FORKS {
for pubkey in pubkeys.iter().take(NUM_PUBKEYS) {
index.upsert(