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

feat(core): batch heavy write operations #1358

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

jrchatruc
Copy link
Collaborator

@jrchatruc jrchatruc commented Nov 29, 2024

Motivation

This PR batches the three current heaviest db write operations on the node (add_block, store_receipts, and commit_node) so that a single db transaction is used for them. This reduces the time spent flushing to disc with msync (on libmdbx) or fsync (on redb) from around ~40-50% to ~0.35%.

Non-batched version:
flamegraph_not_batched

Batched version (the msync on this flamegraph is one of the tiny red bars to the left):
flamegraph_batched

Description

@jrchatruc jrchatruc marked this pull request as ready for review November 29, 2024 21:16
@jrchatruc jrchatruc requested a review from a team as a code owner November 29, 2024 21:16
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.

1 participant