lz4/lz4
FreeExtremely Fast Compression algorithm
About lz4/lz4
LZ4 is a lossless compression algorithm known for its extremely high compression and decompression speeds. It achieves compression speeds of 500 MB/s per core, scaling efficiently with multi-core CPUs, and decompression speeds in multiple GB/s per core, often reaching RAM speed limits. The speed can be dynamically tuned via an 'acceleration' factor, trading compression ratio for faster operation. A high compression variant, LZ4_HC, is also available, offering improved compression ratios at the cost of slower compression while maintaining the same decompression speed. LZ4 supports dictionary compression, both at API and CLI levels, and can be combined with the Zstandard Dictionary Builder for better performance on small files. The library is provided as open-source software under the BSD 2-Clause license and includes a reference implementation in C, with numerous ports in other languages. Benchmarks show LZ4 outperforms many popular compressors (e.g., Snappy, LZO, zlib) in speed while maintaining reasonable compression ratios.
Key Features
Pros & Cons
- Extremely fast compression and decompression
- Multi-core scalability
- Very high decompression speed near RAM limits
- Small code footprint
- Wide language support and portability
- Compression ratio is moderate compared to high-compression algorithms like zstd or lzma
- No built-in encryption or error recovery