Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Reduce locks and real chunked parallelism
  • Loading branch information
ryoqun committed Mar 3, 2020
commit 17e87b3a554db1e6eb9ce73c50ac8a6664291bd5
11 changes: 7 additions & 4 deletions runtime/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -659,11 +659,14 @@ impl AccountsDB {
}
}
}
let reclaim_vecs = all_pubkeys.into_par_iter().map(|pubkey| {
let accounts_index = self.accounts_index.read().unwrap();
let all_pubkeys: Vec<_> = all_pubkeys.into_iter().collect();
let reclaim_vecs = all_pubkeys.par_chunks(4096).map(|pubkeys: &[Pubkey]| {
let mut reclaims = Vec::new();
if !purges.contains_key(&pubkey) {
accounts_index.clean_rooted_entries(&pubkey, &mut reclaims);
let accounts_index = self.accounts_index.read().unwrap();
for pubkey in pubkeys {
if !purges.contains_key(&pubkey) {
accounts_index.clean_rooted_entries(&pubkey, &mut reclaims);
}
}
reclaims
});
Expand Down