Expand description
Gorilla XOR encoding for floating-point timeseries metrics.
Implements the Facebook Gorilla paper’s XOR-based compression for double-precision floating-point values. Achieves ~1.5 bytes per 16-byte (timestamp + value) sample by exploiting temporal locality in metric streams.
Also usable for non-monotonic i64 values by casting through f64 bits.
Wire format:
[4 bytes] sample count (LE u32)
[N bytes] bitstream: first sample raw (64+64 bits), then delta-of-delta
timestamps + XOR-compressed valuesReference: “Gorilla: A Fast, Scalable, In-Memory Time Series Database” (Pelkonen et al., VLDB 2015)
Structs§
- Gorilla
Decoder - Gorilla XOR decoder for (timestamp, f64) sample streams.
- Gorilla
Encoder - Gorilla XOR encoder for (timestamp, f64) sample streams.
Functions§
- decode_
f64 - Decode Gorilla-compressed f64 values (encoded with
encode_f64). - decode_
timestamps - Decode Gorilla-encoded timestamps.
- encode_
f64 - Encode a slice of f64 values using Gorilla XOR compression.
- encode_
timestamps - Encode a slice of i64 timestamps using Gorilla (value channel unused).