From df9a4a0c9dfe6115cdc4b4fefc73eadbc0597b51 Mon Sep 17 00:00:00 2001 From: "Jeff Washington (jwash)" Date: Fri, 6 May 2022 13:35:18 -0500 Subject: [PATCH] Bank::new_for_benches uses bench config (#25017) --- runtime/src/accounts_index.rs | 2 +- runtime/src/bank.rs | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/runtime/src/accounts_index.rs b/runtime/src/accounts_index.rs index 74cb02b06c..30de60fa39 100644 --- a/runtime/src/accounts_index.rs +++ b/runtime/src/accounts_index.rs @@ -44,7 +44,7 @@ use { pub const ITER_BATCH_SIZE: usize = 1000; pub const BINS_DEFAULT: usize = 8192; pub const BINS_FOR_TESTING: usize = 2; // we want > 1, but each bin is a few disk files with a disk based index, so fewer is better -pub const BINS_FOR_BENCHMARKS: usize = 2; +pub const BINS_FOR_BENCHMARKS: usize = 8192; pub const FLUSH_THREADS_TESTING: usize = 1; pub const ACCOUNTS_INDEX_CONFIG_FOR_TESTING: AccountsIndexConfig = AccountsIndexConfig { bins: Some(BINS_FOR_TESTING), diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index 502d916243..637f087fba 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -1366,12 +1366,19 @@ impl Bank { } pub fn new_for_benches(genesis_config: &GenesisConfig) -> Self { - // this will diverge - Self::new_for_tests(genesis_config) + Self::new_with_paths_for_benches( + genesis_config, + Vec::new(), + None, + None, + AccountSecondaryIndexes::default(), + false, + AccountShrinkThreshold::default(), + false, + ) } pub fn new_for_tests(genesis_config: &GenesisConfig) -> Self { - // this will diverge Self::new_with_paths_for_tests( genesis_config, Vec::new(),