Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 1 addition & 17 deletions accounts-db/benches/accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ use {
solana_accounts_db::{
account_info::{AccountInfo, StorageLocation},
accounts::{AccountAddressFilter, Accounts},
accounts_db::{
test_utils::create_test_accounts, AccountFromStorage, AccountsDb,
ACCOUNTS_DB_CONFIG_FOR_BENCHMARKS,
},
accounts_db::{AccountFromStorage, AccountsDb, ACCOUNTS_DB_CONFIG_FOR_BENCHMARKS},
accounts_index::ScanConfig,
ancestors::Ancestors,
},
Expand Down Expand Up @@ -42,19 +39,6 @@ fn new_accounts_db(account_paths: Vec<PathBuf>) -> AccountsDb {
)
}

#[bench]
fn bench_accounts_delta_hash(bencher: &mut Bencher) {
solana_logger::setup();
let accounts_db = new_accounts_db(vec![PathBuf::from("accounts_delta_hash")]);
let accounts = Accounts::new(Arc::new(accounts_db));
let mut pubkeys: Vec<Pubkey> = vec![];
create_test_accounts(&accounts, &mut pubkeys, 100_000, 0);
accounts.accounts_db.add_root_and_flush_write_cache(0);
bencher.iter(|| {
accounts.accounts_db.calculate_accounts_delta_hash(0);
});
}

#[bench]
fn bench_delete_dependencies(bencher: &mut Bencher) {
solana_logger::setup();
Expand Down
39 changes: 0 additions & 39 deletions accounts-db/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6555,36 +6555,6 @@ impl AccountsDb {
}
}

/// Calculate accounts delta hash for `slot`
pub fn calculate_accounts_delta_hash_internal(
&self,
slot: Slot,
ignore: Option<Pubkey>,
) -> AccountsDeltaHash {
let (mut hashes, scan_us, mut accumulate) = self.get_pubkey_hash_for_slot(slot);

if let Some(ignore) = ignore {
hashes.retain(|k| k.0 != ignore);
}

let accounts_delta_hash = self
.thread_pool
.install(|| AccountsDeltaHash(AccountsHasher::accumulate_account_hashes(hashes)));
accumulate.stop();

self.set_accounts_delta_hash(slot, accounts_delta_hash);

self.stats
.delta_hash_scan_time_total_us
.fetch_add(scan_us, Ordering::Relaxed);
self.stats
.delta_hash_accumulate_time_total_us
.fetch_add(accumulate.as_us(), Ordering::Relaxed);
self.stats.delta_hash_num.fetch_add(1, Ordering::Relaxed);

accounts_delta_hash
}

/// Set the accounts delta hash for `slot` in the `accounts_delta_hashes` map
///
/// returns the previous accounts delta hash for `slot`
Expand Down Expand Up @@ -8190,11 +8160,6 @@ impl AccountsDb {
self.flush_root_write_cache(slot);
}

/// Wrapper function to calculate accounts delta hash for `slot` (only used for testing and benchmarking.)
pub fn calculate_accounts_delta_hash(&self, slot: Slot) -> AccountsDeltaHash {
self.calculate_accounts_delta_hash_internal(slot, None)
}

pub fn load_without_fixed_root(
&self,
ancestors: &Ancestors,
Expand All @@ -8210,10 +8175,6 @@ impl AccountsDb {
)
}

pub fn accounts_delta_hashes(&self) -> &Mutex<HashMap<Slot, AccountsDeltaHash>> {
&self.accounts_delta_hashes
}

pub fn accounts_hashes(&self) -> &Mutex<HashMap<Slot, (AccountsHash, /*capitalization*/ u64)>> {
&self.accounts_hashes
}
Expand Down
Loading
Loading