-
Notifications
You must be signed in to change notification settings - Fork 268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perf: remove duplicated rootkey fetch inpruning (9% pruning speedup on osmosis) #1026
perf: remove duplicated rootkey fetch inpruning (9% pruning speedup on osmosis) #1026
Conversation
…eedup on latest osmosis)
WalkthroughThe changes introduce a new Changes
Poem
Tip CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🔇 Additional comments (5)nodedb.go (5)
The
The
The straightforward
Passing in
Here, Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Aiming to update this to have a better cache that should de-duplicate 3 out of the 4 relevant root key calls here |
@Mergifyio backport release/v1.2.x |
✅ Backports have been created
|
@Mergifyio backport release/v1.3.x |
✅ Backports have been created
|
…n osmosis) (backport #1026) (#1027) Co-authored-by: Dev Ojha <[email protected]>
…n osmosis) (backport #1026) (#1028) Co-authored-by: Dev Ojha <[email protected]>
Currently delete version duplicatedly fetches rootkeys. This rootkey fetch does not go through the normal caching logic (as the rootkey fetch call does a direct call to the underlying database. Its not routed through the standard GetNode cache wrappers)
I did a 2 hour long block sync on osmosis, which got through 66000 blocks.
We should cache this root setting logic. Right now root key fetching is ~37% of the block pruning time during my latest sync. And block pruning is 40% of the overall sync time.
This PR does a quick cache to reduce from 4 calls to 3 calls. (TraverseOrphans has 2 calls as well) Ideally we can setup a second cache later on to ensure none of these DB calls get repeated, but for now wanted to keep it simple/uncontroversial with this PR, getting an 9% speedup to pruning's sync time component. (and ~4% to overall block sync)
Summary by CodeRabbit
New Features
Bug Fixes