NewPFD-rs
Rust library implementing the NewPFD integer compression/decompression algorithm.
Performance
It's currently lacking optimization for speed, but it's decently fast. We perform this on geometrically distributed integers (Geo(lambda=0.01)) to force encoding exceptions in the NewPFD-block.
- Encoding: 90ms/ 1M integers
- Decoding: 16ms/ 1M integers
See benchmarks for details.
Examples
For more examples, see the rust-docs.
// Encode some data using NewPFD
use ;
let data = vec!;
let blocksize = 32; // needs to be a mutliple of 32
// encode
let = encode;
// compressed_data is a `bitvec::BitVec` (similar to a Vec<bool>)
// decode
let = decode;
assert_eq!;
assert_eq!; // the entire bitstream was consumed