stable-vec icon indicating copy to clipboard operation
stable-vec copied to clipboard

Layout experiments

Open LukasKalbertodt opened this issue 4 years ago • 0 comments

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: the OptionCore is useful when T is NonNull, 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 is true 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.

LukasKalbertodt avatar Aug 23 '19 09:08 LukasKalbertodt