https://lz4.github.io/lz4/ Toggle navigation LZ4 * Public discussion forum * Versions * Index + Benchmarks + Interoperable LZ4 ports and bindings + Custom LZ4 ports and bindings + Reference usages * Latest Release * Issue Tracker * GitHub LZ4 LZ4 is lossless compression algorithm, providing compression speed > 500 MB/s per core (>0.15 Bytes/cycle). It features an extremely fast decoder, with speed in multiple GB/s per core (~1 Byte/cycle). A high compression derivative, called LZ4_HC, is available, trading customizable CPU time for compression ratio. LZ4 library is provided as open source software using a BSD license. Benchmarks ---------- The benchmark uses the [Open-Source Benchmark program by m^2 (v0.14.2)](http://encode.ru/threads/1371-Filesystem-benchmark?p=33548&viewfull=1#post33548) compiled with GCC v4.6.1 on Linux Ubuntu 64-bits v11.10, The reference system uses a Core i5-3340M @2.7GHz. Benchmark evaluates the compression of reference [Silesia Corpus](http://sun.aei.polsl.pl/~sdeor/index.php?page=silesia) in single-thread mode.

Transfer + Decompression Time @1000Mbit/s (without I/O overwrapping, multithreading)

This benchmark simulates simple "static content transfer" scenario such as OS Kernel compression or video game's static assets (text/images/tables/scripts/etc) which loading from Flash Memory / HDD / SSD.

In this case, compression time is completely ignored. Because only content developers compress the data at once and usually they don't care about its computational cost. But they always care enduser's experience a.k.a. "loading time" and bandwidth.

Please pay attention to "LZ4HC -9" which is quite faster than other methods.

Compression + Transfer + Decompression Time @1000Mbit/s (without I/O overwrapping, multithreading)

This benchmark simulates "dynamic content transfer" scenario such as filesystems, caches, network packets, IPC/RPCs, and databases.

In this case, both compression and decompression times are important. You can observe "Fast compression algorithms" are better than traditional algorithms such as DEFLATE (zlib).

## Documentation The LZ4 block compression format is detailed within [lz4_Block_format](https://github.com/lz4/lz4/blob/master/doc/lz4_Block_format.md). For streaming arbitrarily large amount of data, or compress files of any size, a frame format has been established, detailed within the file [lz4_Frame_format](https://github.com/lz4/lz4/blob/master/doc/lz4_Frame_format.md).
## 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. |Language |Author |URL | |---- |---- |---- | |__Java__ | Apache Commons | https://commons.apache.org/proper/commons-compress/javadocs/api-release/org/apache/commons/compress/compressors/lz4/package-summary.html |__Javascript__ | Pierre Curto | https://github.com/pierrec/node-lz4 |__Python__ multi-threadable | Iotic Labs | https://pypi.python.org/pypi/py-lz4framed |__Python__ standard handlers | Jonathan Underwood | https://pypi.python.org/pypi/lz4 |__Python__ | Christopher Jackson | https://github.com/darkdragn/lz4tools |__C#__ | Milosz Krajewski | https://github.com/MiloszKrajewski/K4os.Compression.LZ4 |__Perl__ | Felix Bytow | http://search.cpan.org/~autinity/Compress-LZ4Frame |__Delphi__ | Hanno Hugenberg | https://github.com/Hugie/lz4-delphi |__Go__ | Pierre Curto | https://github.com/pierrec/lz4 |__Rust__ | Artem Navrotskiy | https://github.com/bozaro/lz4-rs |__Rust__ | picoHz | https://github.com/picoHz/lzzzz |__Dart__ | Instantiations | https://pub.dev/documentation/es_compression/latest/lz4/lz4-library.html |__Lua__ | Witchu Promjunyakul | https://github.com/witchu/lua-lz4 |__Haskell__ | Niklas Hambuchen | https://hackage.haskell.org/package/lz4-frame-conduit |__VA Smalltalk__ | Instantiations | http://www.instantiations.com/docs/91/wwhelp/wwhimpl/js/html/wwhelp.htm#href=pr/compression2.html#pID0E0LB0FA |__Tcl__ decoder | D. Bohdan | https://wiki.tcl-lang.org/48789 |__Z80 assembly__ decoder | Piotr Drapich | http://www.union.org.pl/download/z80/LZ4_Z80.asm |__8086 assembly__ decoder| E. C. Masloch | https://bitbucket.org/ecm/inicomp/src/default/ [block]:https://github.com/lz4/lz4/blob/master/doc/lz4_Block_format.md [frame]:https://github.com/lz4/lz4/blob/master/doc/lz4_Frame_format.md
## Compatible CLI versions Here are a few compatible alternatives to lz4 command line utility : |Name |Author |URL | |---- |---- |---- | |__C++11 multi-threads__ | Takayuki Matsuoka |https://github.com/t-mat/lz4mt | |__LZ4X__ | Ilya Muravyov |https://github.com/encode84/lz4x | |__smalLZ4__ | Stephan Brumme |http://create.stephan-brumme.com/smallz4/ | |__briefLZ4__ | Jorgen 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 |
## Customs LZ4 ports and bindings The following versions compress data blocks with LZ4 compression algorithm in various programming languages. They use the [block] compression format, but add their own frame / header logic. They are not interoperable with LZ4 command line utility. |Language |Author |URL | |-- |-- |-- | |__Java__ | Adrien Grand | https://github.com/lz4/lz4-java |__Perl__ | Gray | http://search.cpan.org/dist/Compress-LZ4/ |__C#__ streaming | Phill Djonov | https://github.com/pdjonov/Lz4Stream |__PHP__ | Kamijo | https://github.com/kjdev/php-ext-lz4 |__Go__ | Branimir Karadzic | https://github.com/bkaradzic/go-lz4 |__Ruby__ | Komiya Atsushi | https://rubygems.org/gems/lz4-ruby |__Rust__ | Alex Crichton | https://github.com/rusty-shell/rust-compress/blob/master/src/lz4.rs |__Rust__ | Patrick Seitz | https://github.com/PSeitz/lz4_flex |__D__ | Jude Young | http://code.dlang.org/packages/lz4-d |__Lua__ | Christophe Delord | http://cdsoft.fr/bl/bonaluna.html |__Haskell__ | Mark Wotton | https://hackage.haskell.org/package/lz4 |__Haskell__ (streaming) | Sven Mattsen | https://hackage.haskell.org/package/lz4-conduit |__Visual Basic 6__ | Tanner_H | http://www.vbforums.com/showthread.php?840413-Compression-in-VB6-modern-solutions |__Erlang__ | Tetsuya Suzuki | https://github.com/szktty/erlang-lz4 |__OCaml__ | Peter Zotov | https://github.com/whitequark/ocaml-lz4 |__Cuda__ | NVidia | https://github.com/NVIDIA/nvcomp |__WASM__ | Raymond Hill | https://github.com/gorhill/lz4-wasm |__C__ decoder (tiny) | Justine Tunney | https://github.com/jart/cosmopolitan/blob/467504308a103865c058f9a0ac858cc22e72240e/libc/nexgen32e/lz4cpy.c |__ARM Cortex assembly__ decoder | Jens Bauer | https://community.arm.com/developer/ip-products/processors/b/processors-ip-blog/posts/lz4-decompression-routine-for-cortex-m0-and-later |__8088 assembly__ decoder | Jim Leonard | http://www.oldskool.org/pc/lz4_8088 |__6502 & 65C02 assembly__ decoder | Peter Ferrie | https://github.com/pararaum/lz4-6502 |__65c816 assembly__ decoder | Olivier Zardini | http://www.brutaldeluxe.fr/products/crossdevtools/lz4/index.html |__68k assembly__ decoder | Arnaud Carre | https://github.com/arnaud-carre/lz4-68k |__Atari XL/XE assembly__ decoder | xxl | http://xxl.atari.pl/lz4-decompressor/ |__Z80 assembly__ decoder | Edouard Berge | https://groups.google.com/forum/#!topic/lz4c/A6TLHThL0c8 |__jsonlz4__ | Avi Halachmi | https://github.com/avih/dejsonlz4 : custom Mozilla LZ4 format
## LZ4 is used by #### Operating Systems
#### File Systems
#### Big Data
#### Search Engine
#### Databases
#### Games
#### Graphics
#### Network
#### Storage
#### Caching
### Hardware
#### Other
### Special Thanks to [Takayuki Matsuoka](https://github.com/t-mat/) who greatly contributed to the creation of this LZ4 webpage ---