bit-long-vec
Vector with fixed bit sized values stored in long. Effective to reduce the amount of memory needed for storage values whose size is not a power of 2. As drawback to set and get values uses additional CPU cycles for bit operations.
Usage
Add this to your Cargo.toml:
[]
= "0.2"
Example
In this particular scenario, we want to store 10 bit values. It takes 200 bytes to store 100 values using short. To store 100 values using a bit long vector, 15 lengths are required, which is 120 bytes. (-40%).
let mut vec = with_fixed_capacity;
for index in 0..100