Load tracing and iteration benchmarks - #2465
Open
sergerad wants to merge 1 commit into
Open
Conversation
sergerad
requested review from
Mirko-von-Leipzig and
kkovaacs
and removed request for
Mirko-von-Leipzig
August 11, 2026 00:26
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.
Summary
Relates to #1697.
Why:
main suspects for the gap are the three RocksDB opens (account tree, nullifier tree, account
state forest), which were invisible in traces and can pay multi-second WAL recovery after a
run without a clean flush.
load-statebenchran a single load, which cannot distinguish first-open WAL recovery from a clean warm restart.
How:
open_tree_storageandopen_forest_storagespans to the RocksDBcreateimplementations in the store loader, with a
pathfield to distinguish the account tree,nullifier tree, and forest opens.
benchmark-store load-stateendpoint with--load-iterations(default 3): thefirst iteration surfaces WAL recovery / cold-cache cost, later iterations measure a clean
warm restart. A percentile summary is printed when more than one iteration runs. A dedicated
flag is used instead of the parent
--iterations(default 10000) to avoid accidentallyrunning 10000 full loads.
tracing-forestfeature to the stress-test crate that renders the per-phasetiming tree. Opt-in because feature unification would otherwise switch the log format of
every binary in a workspace-wide build.
Results:
Even at this toy scale the result backs the issue's hypothesis: the three RocksDB opens are
~63% of load time and were entirely absent from the spans before. Iteration 0 also ran ~2×
slower than iterations 1–2 (38ms vs 18–20ms), consistent with WAL recovery/cold cache on
first open. On testnet data this instrumentation should now attribute most of the ~4.4s gap
directly.
Run it with:
Changelog