NewPFD-rs

Rust library implementing the NewPFD integer compression/decompression algorithm. It's currently lacking optimization for speed, but it's decently fast: - Encoding: 150ms/ 1M integers - Decoding: 20ms/ 1M integers

See benchmarks for details.

Fibonacci encoding/decoding is up to speed with other rust implementations, e.g. fibonnacicodec crate (which I took some code from): - Fibonacci encoding: 182ms/ 1M integers (fibonnacicodec: 170ms) - Fibonacci encoding: 160ms/ 1M integers (fibonnaci_codec: 140ms)

Examples

For more examples, see the rust-docs. ```rust // Encode some data using NewPFD use newpfd::newpfdbitvec::{encode, decode}; let data = vec![10u64,12,10,1,1,2,3]; let blocksize = 32; // needs to be a mutliple of 32

// encode let (compresseddata, _) = encode(data.iter().cloned(), blocksize); // compresseddata is a bitvec::BitVec (similar to a Vec)

// decode let (decompresseddata, bitsprocessed) = decode(&compresseddata, data.len(), blocksize); asserteq!(data, decompresseddata); asserteq!(compresseddata.len(), bitsprocessed); // the entire bitstream was consumed ```