Investigate the possibility of u16 lengths in VarZeroVec #1261
Labels
A-performance
Area: Performance (CPU, Memory)
C-data-infra
Component: provider, datagen, fallback, adapters
Currently VarZeroVec assumes that individual entries may have lengths that fit up to
u32
in size. This is quite reasonable, however this is using 4 bytes per element. It may be more efficient to use au16
here.rkyv
uses u16s but is parametrizable.It's worth discussing whether
VarZeroVec<T>
will ever containT
s that are large enough to need more than au16
s worth of space (64 KB) to store their byte length. Note thatVarZeroVec
s can be nested.Independently of this, it's also worth considering if
VarZeroVec<T>
can be madeVarZeroVec<T, N = 2>
so we can allow for arbitrary length sizes.The text was updated successfully, but these errors were encountered: