-
Notifications
You must be signed in to change notification settings - Fork 111
[storage/log/variable] reduce # of blob read_at
calls from 3 to 2 in read
and read_buffered
#1313
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR optimizes blob reading performance by reducing the number of read_at
syscalls from 3 to 2 when reading journal entries. Instead of making separate calls to read the item data and checksum, the code now reads both in a single operation and extracts the components from the combined buffer.
- Combines item and checksum reads into a single
read_at
call with a larger buffer - Extracts item data and checksum from the combined buffer using slicing
- Removes unnecessary
.as_ref()
calls where direct references are available
b888130
to
663a599
Compare
read_at
calls from 3 to 2 in read
read_at
calls from 3 to 2 in read
b29ef74
to
663a599
Compare
read_at
calls from 3 to 2 in read
read_at
calls from 3 to 2 in read
and read_buffered
663a599
to
7e432ea
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small nits!
7e432ea
to
1a415d7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Codecov ReportAll modified and coverable lines are covered by tests ✅
@@ Coverage Diff @@
## main #1313 +/- ##
==========================================
- Coverage 91.20% 91.20% -0.01%
==========================================
Files 248 248
Lines 62084 62083 -1
==========================================
- Hits 56623 56622 -1
Misses 5461 5461
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Improves performance of most archive::immutable benchmarks by ~30%. This code uses journal.get instead of get_exact. Since prunable archive currently uses get_exact, there is no performance impact on that.