Benchmarks
The library, in memory, measured by lzbench from @inikep, with other compressors, at their levels.
Command line pipelines
These benchmarks measure the command lines themselves, on the same system, in pipelines where a link of limited speed, a storage device or a network, separates stages running at the same time.
Reading static content
Static content, such as an OS kernel or video game assets, is compressed once, then read from storage, and decompressed while it is read.
Each bar measures, for instance for lz4 -9 :
lz4 -9 -c silesia.tar > f.lz4 LINK < f.lz4 | lz4 -d -c > /dev/null
where LINK limits the speed of the storage device
(see bench-pipeline.sh).
Transferring dynamic content
Dynamic content, such as network packets, RPCs or database replication, is compressed, sent over the network, and decompressed, the three at the same time.
Default settings, or a single compression thread.
A single thread : lz4 -T1, zstd -T1, pigz -p 1.
Each bar measures, for instance for lz4 -1 :
lz4 -1 -c < silesia.tar | LINK | lz4 -d -c > /dev/null
where LINK limits the speed of the network
(see bench-pipeline.sh).
Documentation
The LZ4 block compression format is detailed within lz4_Block_format.
To stream data of any size, or to compress files, use the frame format, detailed in lz4_Frame_format.
Interoperable LZ4 ports and bindings
The following versions are provided for languages beyond the C reference version. They are in conformance with the LZ4 block and frame specifications, and are therefore interoperable.
Compatible CLI versions
Here are a few compatible alternatives to lz4 command line utility :
| Name | Author | URL |
|---|---|---|
| smalLZ4 | Stephan Brumme | https://create.stephan-brumme.com/smallz4/ |
| briefLZ4 | Jørgen Ibsen | https://github.com/jibsen/blz4 |
| 7Zip with LZ4 | Tino Reichardt | https://github.com/mcmilk/7-Zip-zstd |
| lz4ultra | Emmanuel Marty | https://github.com/emmanuel-marty/lz4ultra |
Custom LZ4 implementations
The following versions compress data blocks with the LZ4 compression algorithm in various programming languages.
They use the block compression format, and deal with metadata (like compressed_size) in various custom ways (or none at all, letting the caller deal with it).
Consequently, they are not interoperable with LZ4 command line utility, nor (generally) between themselves.
| Language | Author | URL |
|---|---|---|
| C# streaming | Phill Djonov | https://github.com/pdjonov/Lz4Stream |
| Cuda | NVIDIA | https://docs.nvidia.com/cuda/nvcomp/lz4.html |
| PHP | Kamijo | https://github.com/kjdev/php-ext-lz4 |
Compact decoders
Decoders only, often written in assembly, for small or old processors and other environments.
LZ4 is used by
A sample : each entry links to a source showing how LZ4 is used.
Operating systems


COMPRESSION_LZ4)
compression=on selects LZ4
lz4_compress feature)

Memory and disks
Fast enough to stay always on.

compression=on


Boot and loading
Decompression speed shortens load times.






Network and streams
Compression at network speed.

compression.type=lz4 for messages


pcap-log) compressed with LZ4
Databases
Compressed blocks read back fast.





File formats
Stored compressed, decoded on read.

LZ4_RAW codec



Accelerators
Offload the CPU.



The Android robot is reproduced or modified from work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License.


