An extremely fast lossless compression algorithm offering speeds over 500 MB/s per core with a high-speed decoder.
LZ4 is an open-source lossless compression algorithm focused on extreme speed, offering compression rates over 500 MB/s per core and a decoder that reaches multiple GB/s per core. It solves the need for real-time data compression in performance-sensitive applications where throughput is critical. The algorithm provides tunable compression levels and maintains consistent high-speed decompression across all variants.
Developers and engineers working on performance-critical systems, real-time data processing, embedded devices, gaming, databases, and network applications where compression speed is paramount.
Developers choose LZ4 for its unmatched compression and decompression speeds, low CPU overhead, and scalability across multi-core systems. Its simplicity, BSD 2-Clause license, and wide language portability make it a go-to for high-performance compression needs.
Extremely Fast Compression algorithm
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
LZ4 achieves over 500 MB/s per core in compression, with benchmarks showing 780 MB/s for the default version, making it one of the fastest algorithms available.
Decompression speeds reach multiple GB/s per core, up to 4970 MB/s in benchmarks, often saturating RAM bandwidth for quick data access.
The acceleration factor allows dynamic trade-offs between compression ratio and speed, and LZ4_HC offers higher compression (up to 2.721 ratio) at the cost of slower compression speeds.
Compatible with dictionary compression via API and CLI, and can be combined with the Zstandard Dictionary Builder for improved performance on small files, as noted in the README.
Compared to algorithms like Zstandard, LZ4 has a lower compression factor (2.101 vs 2.883 in benchmarks), resulting in larger file sizes for the same data.
To effectively compress small files, additional steps like using the Zstandard Dictionary Builder are required, adding setup complexity beyond basic usage.
LZ4 uses its own block and frame formats, which might not be as widely supported as ZIP or GZIP in some ecosystems, potentially hindering interoperability.