You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// The value of the storage. It is wrapped into the `Arc` to provide less cloning of massive objects.
pub type Value = alloc::sync::Arc<Vec<u8>>;
Both the Arc and Vec are pointers to heap-allocated data, which means that we do two heap-lookups every time we read data from this type. We could skip the second heap allocation by replacing this type with Arc<[u8]>.
Definition of done
The kv_store::Value type is defined as an Arc<[u8]>.
Context
The
Value
type is currently defined asBoth the
Arc
andVec
are pointers to heap-allocated data, which means that we do two heap-lookups every time we read data from this type. We could skip the second heap allocation by replacing this type withArc<[u8]>
.Definition of done
The
kv_store::Value
type is defined as anArc<[u8]>
.References
Logan Smith has an interesting video on the topic which elaborates more on this https://www.youtube.com/watch?v=A4cKi7PTJSs
The text was updated successfully, but these errors were encountered: