Pure-Rust implementation of ZFP — a compression algorithm for compressed floating-point and integer arrays. Produces bit-for-bit identical compressed output to the original C implementation.
zfp-rs is a ground-up Rust rewrite, not a binding or wrapper.
Where it differs:
- Idiomatic and Safe API: Safe public API with lifetime-checked borrows.
- Performance: 2–4x faster than the serial C reference across all modes and types.
- Parallel compression and fixed-rate decompression: With the
rayonfeature, compression can be parallelized across all modes. Fixed-rate decompression is parallelized via per-thread bitstream seeking. The C library does not parallelize decompression. - Zero-C dependency chain: No C compiler and no pkg-config.
The zfp-rs-ffi crate provides a C-compatible ABI mirroring zfp-sys.
zfp-rs-ffi can be used as a drop-in replacement for the zfp-sys in Rust projects:
zfp-sys = { package = "zfp-rs-ffi", version = "0.1" }This implementation is based on zfp.
The algorithm is described in the zfp documentation and in the following paper:
- James Diffenderfer, Alyson Fox, Jeffrey Hittinger, Geoffrey Sanders, Peter Lindstrom. Error Analysis of ZFP Compression for Floating-Point Data. SIAM Journal on Scientific Computing, 41(3):A1867-A1898, June 2019. doi:10.1137/18M1168832.