feat(db): use write buffer to speed up state migrations#5588
Merged
hanabi1224 merged 4 commits intomainfrom Apr 22, 2025
Merged
feat(db): use write buffer to speed up state migrations#5588hanabi1224 merged 4 commits intomainfrom
hanabi1224 merged 4 commits intomainfrom
Conversation
7d7caa1 to
ac04623
Compare
|
|
||
| impl<DB: Blockstore> BlockstoreWithWriteBuffer<DB> { | ||
| pub fn new(inner: DB) -> Self { | ||
| Self::new_with_capacity(inner, 10000) |
Member
There was a problem hiding this comment.
Let's have it configurable so that operators with more memory in their box can potentially increase this. It'd be great to note how much memory increase should one expect with every 10k buffer increment.
| Ok(None) | ||
| } | ||
|
|
||
| pub struct BlockstoreWithWriteBuffer<DB: Blockstore> { |
Member
There was a problem hiding this comment.
The code is straightforward, but it'd still be great to have some coverage there, especially given that locking mechanisms are involved.
elmattic
reviewed
Apr 22, 2025
092cc80 to
13f8e4f
Compare
elmattic
approved these changes
Apr 22, 2025
LesnyRumcajs
approved these changes
Apr 22, 2025
sudo-shashank
approved these changes
Apr 22, 2025
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.
Summary of changes
As discussed on slack, this PR implements write buffer to speed up state migrations
On my laptop, nv25 mainnet upgrade takes 5m with 10k buffer, and 22m without buffer.
Changes introduced in this pull request:
Reference issue to close (if applicable)
Closes
Other information and links
Change checklist