-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
(LedgerStore) LedgerColumn::multi_get() #26354
Conversation
The multi_get() API will be used to optimize get_slots_since() mentioned in #24878 |
Converting this PR back to a draft as we need a published version of rust-rocksdb release. |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
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.
Just the clippy thing; otherwise, LGTM!
Out of curiosity, any idea what kind of improvements this yields vs. just calling get()
repeatedly ?
ledger/src/blockstore_db.rs
Outdated
@@ -1289,6 +1307,41 @@ impl<C> LedgerColumn<C> | |||
where | |||
C: TypedColumn + ColumnName, | |||
{ | |||
#[allow(clippy::needless_range_loop)] |
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.
We should be able to drop this now right?
So the batched version of multi_get() will try to group multiple get() requests into multiple batches where get() requests in the same batch will hit the same block. As a result, each batch of get() requests can be answered using one single disk read instead of multiple ones. |
Pull request has been modified.
Problem
Blockstore operations such as get_slots_since() issues multiple rocksdb::get()
at once which is not optimal for performance.
Summary of Changes
This PR adds LedgerColumn::multi_get() based on rocksdb::batched_multi_get(),
the optimized version of multi_get() where get requests are processed in batch
to minimize read I/O.