Skip to content

Commit

Permalink
Runs accounts lt hash startup calculation in thread pool (anza-xyz#3380)
Browse files Browse the repository at this point in the history
  • Loading branch information
brooksprumo authored Oct 30, 2024
1 parent 990f938 commit d968309
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions runtime/src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1732,13 +1732,15 @@ impl Bank {
// then it will be *required* that the snapshot contains an accounts lt hash.
let accounts_lt_hash = fields.accounts_lt_hash.unwrap_or_else(|| {
let (accounts_lt_hash, duration) = meas_dur!({
bank.rc
.accounts
.accounts_db
.calculate_accounts_lt_hash_at_startup_from_index(
&bank.ancestors,
bank.slot(),
)
thread_pool.install(|| {
bank.rc
.accounts
.accounts_db
.calculate_accounts_lt_hash_at_startup_from_index(
&bank.ancestors,
bank.slot(),
)
})
});
calculate_accounts_lt_hash_duration = Some(duration);
accounts_lt_hash
Expand Down

0 comments on commit d968309

Please sign in to comment.