-
Notifications
You must be signed in to change notification settings - Fork 271
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
blockstore: Reduce intermediate collects from multi_get() #4312
Conversation
6823bf4
to
dc666ab
Compare
Extra copy too on the vecs from SlotMeta
dc666ab
to
ab16249
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.
Decent amount of whitespace change in this PR - I tried to keep cargo fmt
runs in their own commits so reviewing commit-by-commit and/or hiding whitespace might reduce the noise
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.
couple of questions. Looks like a nice improvement over all
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.
LGTM, just a note about potentially collecting rather than Vec::with_capacity()
Problem
The rocksdb
multi_get()
method allows us to fetch multiple values in a single rocksdb call. We currently return the results as aVec
by collecting item inLedgerColumn
methods. But, we then immediately thoseVec
's, making the intermediate.collect()
useless and wasteful.Summary of Changes
multi_get()
methods so the keys live long enoughmulti_get()
methods returnimpl Iterator ...
and update call sites