perf(serde_snapshot): build versioned epoch stakes in thread#10002
Merged
kskalski merged 2 commits intoanza-xyz:masterfrom Jan 15, 2026
Merged
perf(serde_snapshot): build versioned epoch stakes in thread#10002kskalski merged 2 commits intoanza-xyz:masterfrom
kskalski merged 2 commits intoanza-xyz:masterfrom
Conversation
af1c0e9 to
a3842ca
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #10002 +/- ##
=======================================
Coverage 82.5% 82.5%
=======================================
Files 844 844
Lines 316758 316780 +22
=======================================
+ Hits 261579 261622 +43
+ Misses 55179 55158 -21 🚀 New features to boost your workflow:
|
brooksprumo
reviewed
Jan 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
#9831 changed deserialization of epoch stakes to intermediate representation as cheaper vectors, but at some point the final
im::HashMapneed to be constructed, which is a slow CPU-bound process (can take even >8s). Current this is done serially after accounts db index is built.Since this part of bank data initialization is independent from calculating accounts db, it could be done in separate thread such that it's ready once accounts db reconstruction is done.
Summary of Changes
versioned_epoch_stakesinBankFieldsToDeserializetoVec(this makes deserialization even slightly cheaper), since it's intermediate representation that is only iterated on laterHashMap<Epoch, VersionedEpochStakes>in separate thread spawned beforereconstruct_accountsdb_from_fieldsBank::new_from_snapshotto be used instead of reading fromfields.versioned_epoch_stakesPerformance change
Time between loading stakes and finishing
new_from_snapshot(rent_collectorlog line) shrinks from4.22sto0.011sPR
master