LZ4
LZ4 is a high-speed LZ77 variant developed by Yann Collet, trading some compression ratio for extremely fast encode/decode speeds (GB/s class).
Purpose
It provides fast lossless compression for latency-sensitive scenarios such as real-time transport, in-memory databases, and log pipelines.
Mechanism
It uses LZ77 sliding-window matching but skips complex optimal parsing, employing greedy matching accelerated by a hash table, and outputs (token, literals, match) records. Decoding is pure copying with no deserialization overhead and is extremely fast.
Use cases
- Real-time data transport
- Linux kernel compression
- Log and cache pipelines