Expand description
Structsยง
- Packed
Vec - A
PackedVec
stores vectors of integers efficiently while providing an API similar toVec
. The basic idea is to store each element using the minimum number of bits needed to represent every element in theVec
. For example, if we have aVec<u64>
with elements [20, 30, 140], every element wastes most of its 64 bits: 7 bits is sufficient to represent the range of elements in the vector. Given this input vector,PackedVec
stores each elements using exactly 7 bits, saving substantial memory. For vectors which often contain small ranges of numbers, and which are created rarely, but read from frequently, this can be a significant memory and performance win. - Packed
VecIter