Repository navigation
page_cache: one shard per root child so merkle update tasks balance across workers - #978
Merged
rphmeier merged 1 commit intoNov 17, 2026
Conversation
…cross workers Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
citizen-stig
marked this pull request as ready for review
November 17, 2026 08:27
This was referenced Nov 17, 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.
What
PageCachenow always has 64 shards, one per child of the root page, instead ofcommit_concurrencyshards. The total cache size is unchanged.Why
Each shard is one merkle update task on the
commit_concurrency-thread pool. With one shard per thread,finishwaits for the slowest key range, and threads that finish early sit idle. With 64 smaller tasks, idle threads pick up the remaining ones, so the load balances itself.Benchmarks
finish_benchmeanfinish, 8 runsbenchtoptransfer,commit_concurrency4:commit_and_provebenchtoptransfer,commit_concurrency1:commit_and_proveAn earlier 5-run round gave the same
finishresult (123.0 → 113.3 ms).into_overlayis unchanged.finish_bench: an isolatedSession::finishbenchmark with the user-namespace access profile of a Sovereign SDK node (benchtop/src/bin/finish_bench.rs@ 3469d5c, not part of this PR). 50k–145kReadThenWriteaccesses per slot (68% updates with the prior value, 32% inserts), 36-byte values,BinaryHasher<Sha256>, rollback on,commit_concurrency6, tree growing from 5.35M to 6.26M leaves, 10 warm-up + 20 measured slots from a restored seed DB. AMD Ryzen 7 7700, pinned to 12 threads, base and branch runs interleaved. Every run ends at the same root.benchtoptransfer:-c 22 -s 20000 --commit-concurrency 4 --op-limit 3000000, 4 interleaved runs on one DB copy (noisy: mastercommit_and_provesd ≈ 9 ms).🤖 Generated with Claude Code