-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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: Change kv_store::Value
to be Arc<[u8]> instead of Arc<Vec<u8>>
#2411
base: 2344-add-support-for-multi-get-operation-in-the-database
Are you sure you want to change the base?
Conversation
ea91e81
to
a5f9d5d
Compare
perhaps we want to benchmark the difference in performance :) |
Yep, running the |
I can't see any conclusive difference between the implementations with the existing benchmarks. There's a high degree of variation between the runs and the benchmarks are mostly measuring retrieval times for large objects - so the extra heap allocation is negligible for these benchmarks. I'll experiment with a benchmarks where we do more reads of the returned values to see if I can measure a performance impact. |
Though thinking more on this, since this represent a database value and will always be associated with a database operation - I don't see any scenario where we use this where the performance impact of the extra heap allocation isn't completely negligible in comparison to the database lookup. So given that this change is very low prio I can't motivate taking the time to construct a benchmark exposing this difference, although it would have been fun to do so 😅 |
kv_store::Value
to be Arc<[u8]> instead of Arc<Vec<u8>>kv_store::Value
to be Arc<[u8]> instead of Arc<Vec<u8>>
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.
I think we can merge it without benchmarks=)
b23e4be
to
676a5d4
Compare
Wonderful, let's get the multi-get merged first and follow up with this one afterwards #2396 |
a5f9d5d
to
07ed126
Compare
3a3d967
to
cbb6efc
Compare
Linked Issues/PRs
Closes #2379
Description
This PR simplifies the
kv_store::Value
type to beArc<[u8]>
instead ofArc<Vec<u8>>
. This makes the code slightly cleaner and also provides a (completely negligible) performance benefit as we skip an unnecessary extra heap allocation.Checklist
Before requesting review