cleanup (#27453)
* cleanup * Update runtime/src/accounts_db.rs Co-authored-by: Brooks Prumo <brooks@prumo.org> Co-authored-by: Brooks Prumo <brooks@prumo.org>
This commit is contained in:
parent
e35cd7a34a
commit
9bde3261fd
|
@ -3854,8 +3854,11 @@ impl AccountsDb {
|
|||
} = self.get_unique_accounts_from_storages(old_storages.iter());
|
||||
|
||||
// sort by pubkey to keep account index lookups close
|
||||
let mut stored_accounts = stored_accounts.into_iter().collect::<Vec<_>>();
|
||||
stored_accounts.sort_unstable_by(|a, b| a.0.cmp(&b.0));
|
||||
let stored_accounts = {
|
||||
let mut stored_accounts = stored_accounts.into_iter().collect::<Vec<_>>();
|
||||
stored_accounts.sort_unstable_by(|a, b| a.0.cmp(&b.0));
|
||||
stored_accounts
|
||||
};
|
||||
|
||||
let mut index_read_elapsed = Measure::start("index_read_elapsed");
|
||||
let alive_total_collect = AtomicUsize::new(0);
|
||||
|
@ -3895,7 +3898,6 @@ impl AccountsDb {
|
|||
let alive_total = alive_total_collect.load(Ordering::Relaxed);
|
||||
index_read_elapsed.stop();
|
||||
let aligned_total: u64 = Self::page_align(alive_total as u64);
|
||||
// we could sort these
|
||||
// could follow what shrink does more closely
|
||||
if stored_accounts.is_empty() {
|
||||
continue; // skipping slot with no useful accounts to write
|
||||
|
|
Loading…
Reference in New Issue