Skip to main content

Module pcodec

Module pcodec 

Source
Expand description

Pcodec wrapper for complex numerical sequences.

For data where ALP’s decimal-to-integer trick doesn’t apply (scientific floats, irregular numerical sequences, CRDT operation counters), Pcodec builds a probabilistic model of the data distribution, separates high-order structure from low-order noise, and compresses each independently.

Compression: 30-100% better ratio than Zstd on numerical data. Decode: 1-4 GB/s.

Wire format: Pcodec’s native format with a 5-byte NodeDB header:

[1 byte]  type tag (0=f64, 1=i64)
[4 bytes] value count (LE u32)
[N bytes] pco compressed data

Functions§

decode_f64
Decompress Pcodec f64 data.
decode_i64
Decompress Pcodec i64 data.
encode_f64
Compress f64 values using Pcodec.
encode_i64
Compress i64 values using Pcodec.