From d9683093ec5ce3138ab94332e248c524a2e60454 Mon Sep 17 00:00:00 2001 From: Brooks Date: Wed, 30 Oct 2024 15:40:44 -0400 Subject: [PATCH] Runs accounts lt hash startup calculation in thread pool (#3380) --- runtime/src/bank.rs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index 66d3720da513c1..46f734099f286a 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -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