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

core: periodically flush the transaction indexes #24197

Merged
merged 1 commit into from
Jan 11, 2022

Conversation

rjl493456442
Copy link
Member

It turns out memory allocation is really inefficient in goleveldb batch. Constructing a large batch will take a few seconds and most of the time is spent on memory allocation.

During the chain sync we noticed transaction indexing is expensive, one big cost is constructing a large batch for indexes. Therefore in this PR the single huge batch is divided into several small one according to the ideal batch size.

@rjl493456442
Copy link
Member Author

Need to run the snap sync benchmark to see the performance difference.

Copy link
Contributor

@holiman holiman left a comment

Choose a reason for hiding this comment

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

LGTM

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.

LGTM

@karalabe karalabe added this to the 1.10.16 milestone Jan 11, 2022
@karalabe karalabe merged commit acd7b36 into ethereum:master Jan 11, 2022
sidhujag pushed a commit to syscoin/go-ethereum that referenced this pull request Jan 12, 2022
…h-batch

core: periodically flush the transaction indexes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants