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: use BufWriter on NippyJarWriter #6482

Merged
merged 11 commits into from
Feb 8, 2024

Conversation

joshieDo
Copy link
Collaborator

@joshieDo joshieDo commented Feb 8, 2024

As the title suggests. This change speeds up the writing during historical sync because it reduces the number of write system calls. By doing so, we achieve a writing speed that is comparable to or better than that of the main branch.

However, adopting this change means that whenever we work with File::metadata.len(), File::set_len or handle seeks/position streams, we need to flush it first

@joshieDo joshieDo requested a review from rakita as a code owner February 8, 2024 11:34
Base automatically changed from joshie/segment-header to feat/static-files February 8, 2024 11:37
Copy link
Collaborator

@shekhirin shekhirin left a comment

Choose a reason for hiding this comment

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

LGTM, good find. File doesn't use any buffering on writing underneath, and goes directly to libc::write.

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

lgtm

@joshieDo joshieDo merged commit d9e0634 into feat/static-files Feb 8, 2024
22 of 24 checks passed
@joshieDo joshieDo deleted the joshie/buffered-write branch February 8, 2024 12:21
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.

4 participants