Skip to content
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

trie, core, eth: use db.has over db.get where possible #24117

Merged
merged 1 commit into from
Jan 6, 2022

Conversation

holiman
Copy link
Contributor

@holiman holiman commented Dec 15, 2021

When doing some syncs, I noticed that in the heal phase, the db reads is going through the roof. This PR aims to bring that down a little bit, or at least reduce some allocation when that happens, by using db.Has wherever possible.

I'll do a benchmark later, also to verify that it doesn't break anything.

@holiman
Copy link
Contributor Author

holiman commented Dec 16, 2021

Finished a snap-sync (with blocks already present): https://geth-bench.ethdevops.io/d/Jpk-Be5Wk/dual-geth?orgId=1&from=1639661782210&to=1639685566480 . No obvious difference in charts, but it seems at least that it doesn't break anything.

@holiman holiman marked this pull request as ready for review December 16, 2021 20:16
Copy link
Member

@karalabe karalabe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM

@karalabe karalabe added this to the 1.10.16 milestone Jan 6, 2022
@karalabe karalabe merged commit af2ca5a into ethereum:master Jan 6, 2022
sidhujag pushed a commit to syscoin/go-ethereum that referenced this pull request Jan 11, 2022
trie, core, eth: use db.has over db.get where possible
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants