stable-vec
stable-vec copied to clipboard
Layout experiments
There are some things we could be experimenting with. They might lead to a performance improvement, but this needs to be checked.
-
A
Vec<T>
core with user-specified nil-value: theOptionCore
is useful whenT
isNonNull
, i.e. the 0-bit pattern is never used. But sometimes other bit patterns are not used, which could be used to indicate an empty slot. -
compact: bool
: store a boolean that istrue
if the stable vec is still compact. In this case, we don't have to store any additional information for slots (i.e. not bit vec). This could be useful in situation where no element is removed as this saves memory and could be faster. But it might also be slower in general because it adds complexity.