<a name="benchmarks"></a> 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. <div> <ul id="tabs" class="nav nav-tabs" data-tabs="tabs"> <li class="active"><a href="#tab-1" data-toggle="tab">Transfer + Decompression Time<br/>@1000Mbit/s</a></li> <li ><a href="#tab-2" data-toggle="tab">Compression + Transfer + Decompression Time<br/>@1000Mbit/s</a></li> </ul> <div id="my-tab-content" class="tab-content"> <div id="tab-1" class="tab-pane container-fluid active"> <div class="row"> <div class="col-md-4 text-justify"> <h2>Transfer + Decompression Time @1000Mbit/s <small>(without I/O overwrapping, multithreading)</small></h2> <p> 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. </p> <p> 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. </p> <p> Please pay attention to "LZ4HC -9" which is quite faster than other methods. </p> </div> <div class="col-md-8" style="height:34em;" data-csv-props='{ "csvSrc": "csv/benchmark-silesia-1000mbps-offline-compression.csv", "csvGvType": "google.visualization.ColumnChart", "csvGvPackage": "corechart", "chartArea": {"width": "80%", "height": "30em"}, "legend": {"position": "top"}, "isStacked": "true", "vAxis": {"title": "Seconds" }, "title": "Transfer + Decompression Time\nSMALLER IS BETTER" }' ></div> </div> </div> <div id="tab-2" class="tab-pane container-fluid"> <div class="row"> <div class="col-md-4 text-justify"> <h2>Compression + Transfer + Decompression Time @1000Mbit/s <small>(without I/O overwrapping, multithreading)</small></h2> <p> This benchmark simulates "dynamic content transfer" scenario such as filesystems, caches, network packets, IPC/RPCs, and databases. </p> <p> 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). </p> </div> <div class="col-md-8" style="height:34em;" data-csv-props='{ "csvSrc": "csv/benchmark-silesia-1000mbps.csv", "csvGvType": "google.visualization.ColumnChart", "csvGvPackage": "corechart", "chartArea": {"width": "80%", "height": "30em"}, "legend": {"position": "top"}, "isStacked": "true", "vAxis": {"title": "Seconds" }, "title": "Compression + Transfer + Decompression Time\nSMALLER IS BETTER" }' ></div> </div> </div> </div> </div> ## 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). <br/> <a name="interoperable-lz4"></a> ## 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 | |---- |---- |---- | |__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 |__Java__ | Apache Commons | https://commons.apache.org/proper/commons-compress/javadocs/api-release/org/apache/commons/compress/compressors/lz4/package-summary.html |__Javascript__ (binding) | Pierre Curto | https://github.com/pierrec/node-lz4 |__Javascript__ (port) | Benzinga | https://github.com/Benzinga/lz4js |__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 |__Rust__ | Pascal Seitz | https://github.com/PSeitz/lz4_flex |__Dart__ | Instantiations | https://pub.dev/documentation/es_compression/latest/lz4/lz4-library.html |__Lua__ | Witchu Promjunyakul | https://github.com/witchu/lua-lz4 |__Haskell__ | Niklas Hambüchen | 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 |__WASM__ | Syu Kato | https://github.com/ukyo/lz4.js |__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://hg.pushbx.org/ecm/inicomp/ [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 <br/> <a name="lz4-clis"></a> ## 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 | |__smalLZ4__ | Stephan Brumme |http://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 | <br/> <a name="customs-lz4"></a> ## Customs LZ4 implementations 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 (or none at all) Consequently, they are not interoperable with LZ4 command line utility, nor (generally) between themselves. |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 |__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 |__arm64 assembly__ decoder | Siguza | https://github.com/Siguza/lz4dec |__Risc-V assembly__ decoder | Martin Wendt | https://github.com/enthusi/lz4_rv32i_decode |__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 |__Z80 assembly__ decoder | Edouard Berge | https://groups.google.com/forum/#!topic/lz4c/A6TLHThL0c8 |__Atari XL/XE assembly__ decoder | xxl | http://xxl.atari.pl/lz4-decompressor/ |__v810 assembly__ decoder | Martin Wendt | https://github.com/enthusi/lz4_v810_decode |__Lua__ decoder | Scott Lembcke | https://github.com/slembcke/mini-lz4 |__jsonlz4__ decoder | Avi Halachmi | https://github.com/avih/dejsonlz4 : custom Mozilla LZ4 format <br/> <a name="references"></a> ## LZ4 is used by #### Operating Systems <div id="lz4usedby" class="container"> <ul id="icons" class="list-inline"> <li><a href="https://www.linux.org" ><img src="images/logo50/linux.png" /><span> Linux</span></a></li> <li><a href="https://www.freebsd.org/" ><img src="images/logo50/freebsd.png" /><span> FreeBSD</span></a></li> <li><a href="https://www.illumos.org/" ><img src="images/logo50/illumos.png" /><span> Illumos</span></a></li> <li><a href="http://coreboot.org/" ><img src="images/logo50/coreboot.png"/><span> coreboot</span></a></li> <li><a href="https://smartos.org/" ><img src="images/logo50/smartos.png" /><span> SmartOS</span></a></li> <li><a href="https://www.zephyrproject.org/"><img src="images/logo50/zephyros.png"/><span> ZephyrOS</span></a></li> </ul> </div> #### File Systems <div id="lz4usedby" class="container"> <ul id="icons" class="list-inline"> <li><a href="https://www.open-zfs.org/wiki/Main_Page"><img src="images/logo50/openzfs.png" /><span> OpenZFS</span></a></li> <li><a href="https://squashfs.sourceforge.net/" ><img src="images/logo50/squashfs.png"/><span> SquashFS</span></a></li> <li><a href="https://source.android.com/docs/core/architecture/kernel/erofs"><img src="images/logo50/erofs50.png" /><span> EROFS</span></a></li> <li><a href="https://www.dragonflybsd.org/hammer/" ><img src="images/logo50/hammer.png" /><span> HAMMER2</span></a></li> <li><a href="http://www.lessfs.com/wordpress/" ><img src="images/logo50/lessfs.png" /><span> LessFS</span></a></li> <li><a href="https://leo-project.net/leofs/" ><img src="images/logo50/leofs.png" /><span> LeoFS</span></a></li> <li><a href="https://www.gnu.org/software/grub/" ><img src="images/logo50/grub.png" /><span> GNU GRUB</span></a></li> </ul> </div> #### Big Data <div id="lz4usedby" class="container"> <ul id="icons" class="list-inline"> <li><a href="https://hadoop.apache.org/" ><img src="images/logo50/hadoop.png" /><span> Hadoop</span></a></li> <li><a href="https://cassandra.apache.org/" ><img src="images/logo50/cassandra.png" /><span> Cassandra</span></a></li> <li><a href="https://hbase.apache.org/" ><img src="images/logo50/hbaseW90.png" /><span> Hbase</span></a></li> <li><a href="https://spark.apache.org/" ><img src="images/logo50/spark.png" /><span> Spark</span></a></li> <li><a href="https://github.com/chango/hustle" ><img src="images/logo50/hustleW90.png" /><span> Hustle</span></a></li> </ul> </div> #### Search Engine <div id="lz4usedby" class="container"> <ul id="icons" class="list-inline"> <li><a href="https://lucene.apache.org/" ><img src="images/logo50/lucene.png" /><span> Lucene</span></a></li> <li><a href="https://lucene.apache.org/solr/" ><img src="images/logo50/solr.png" /><span> solr</span></a></li> <li><a href="https://www.scalyr.com/" ><img src="images/logo50/scalyr.png" /><span> Scalyr</span></a></li> <li><a href="https://kafka.apache.org/" ><img src="images/logo50/kafka.png" /><span> Kafka</span></a></li> <li><a href="https://groonga.org/docs/news.html#release-10-0-8"><img src="images/logo50/groonga.png"/><span> Groonga</span></a></li> </ul> </div> #### Databases <div id="lz4usedby" class="container"> <ul id="icons" class="list-inline"> <li><a href="https://www.mysql.com/" ><img src="images/logo50/mysql.png" /><span> MySQL</span></a></li> <li><a href="https://rocksdb.org/" ><img src="images/logo50/rocksdb.png" /><span> RocksDB</span></a></li> <li><a href="https://www.tokutek.com/tokudb-for-mysql/" ><img src="images/logo50/tokudb.png" /><span> Tokudb</span></a></li> <li><a href="http://redis.io/" ><img src="images/logo50/redis.png" /><span> Redis</span></a></li> <li><a href="https://www.delphix.com/" ><img src="images/logo50/delphix.png" /><span> Delphix</span></a></li> <li><a href="http://www.infinisql.org/" ><img src="images/logo50/infinisql.png" /><span> infiniSQL</span></a></li> <li><a href="http://sophia.systems/" ><img src="images/logo50/sophia50.png" /><span> Sophia</span></a></li> <li><a href="https://olegdb.org/" ><img src="images/logo50/olegdb.png" /><span> OlegDB</span></a></li> <li><a href="https://gemtalksystems.com/products/gs64/" ><img src="images/logo50/gemstone.png" /><span> GemStone</span></a></li> <li><a href="https://www.percona.com/blog/2016/08/11/percona-server-mongodb-3-2-8-2-0-now-available/"> <img src="images/logo50/percona.png" /><span> Percona</span></a></li> <li><a href="https://github.com/adjust/pg_cryogen" ><img src="images/logo50/postgresql.png" /><span> PostgreSQL</span></a></li> </ul> </div> #### Games <div class="container"> <ul class="list-inline"> <li><a href="http://www.nintendo.com/switch/" ><img src="images/logo50/switch.png" /><span> Nintendo Switch</span></a></li> <li><a href="https://unity.com/" ><img src="images/logo50/unity.png" /><span> Unity</span></a></li> <li><a href="https://www.pcgamer.com/how-hitman-3s-devs-shrank-the-entire-trilogys-install-size-by-over-80gb/"><img src="images/logo50/hitman3.png"/><span> Hitman 3</span></a></li> <li><a href="http://www.kojimaproductions.jp/en/death_stranding.html"><img src="images/logo50/deathstranding.png"/><span> Death Stranding</span></a></li> <li><a href="https://www.battlefield.com/battlefield-4" ><img src="images/logo50/battlefield4.png" /><span> Battlefield 4</span></a></li> <li><a href="https://www.guildwars2.com/" ><img src="images/logo50/guildwars2.png" /><span> Guild Wars 2</span></a></li> <li><a href="http://www.crytek.com/" ><img src="images/logo50/crytek.png" /><span> Crytek</span></a></li> <li><a href="https://www.callofduty.com/fr/blackops3" ><img src="images/logo50/blackOps3.png" /><span> Black Ops 3</span></a></li> <li><a href="https://youtu.be/DkspHgt27Io?t=712" ><img src="images/logo50/CoD_BO_CW.png" /><span> Black Ops Cold War</span></a></li> <li><a href="https://www.easports.com/fr/fifa" ><img src="images/logo50/fifa.png" /><span> FIFA</span></a></li> <li><a href="https://www.sinemoragame.com/" ><img src="images/logo50/sinemora.png" /><span> Sine Mora</span></a></li> <li><a href="https://www.youtube.com/watch?v=wjN9vkWKZIU"><img src="images/logo50/1000tinycraws.png"/><span> 1000 Tiny Claws</span></a></li> </ul> </div> #### Graphics <div id="lz4usedby" class="container"> <ul id="icons" class="list-inline"> <li><a href="https://www.nvidia.com/" ><img src="images/logo50/nvidia.png" /><span> nVidia</span></a></li> <li><a href="https://www.enlightenment.org/" ><img src="images/logo50/enlightment.png" /><span> Enlightenment</span></a></li> <li><a href="https://www.xpra.org/" ><img src="images/logo50/xpra.png" /><span> Xpra</span></a></li> <li><a href="https://www.openvdb.org/" ><img src="images/logo50/openvdb.png" /><span> OpenVDB</span></a></li> <li><a href="https://pixinsight.com/" ><img src="images/logo50/pixInsight.png" /><span> PixInsight</span></a></li> <li><a href="https://scap.codeplex.com/" ><img src="images/logo50/placeholder.png" /><span> Scaplib</span></a></li> <li><a href="https://github.com/flanglet/kanzi" ><img src="images/logo50/placeholder.png" /><span> kanzi</span></a></li> <li><a href="https://pgbackrest.org/release.html#supportedi"><img src="images/logo50/placeholder.png"/><span> pgBackRest</span></a></li> </ul> </div> #### Network <div id="lz4usedby" class="container"> <ul id="icons" class="list-inline"> <li><a href="https://openvpn.net/" ><img src="images/logo50/openvpn.png" /><span> openVPN</span></a></li> <li><a href="https://training.ti.com/simplelink-msp432-bluetooth-low-energy-ota-lz4-compression"><img src="images/logo50/ti.png"/><span> SimpleLink</span></a></li> <li><a href="https://netty.io/" ><img src="images/logo50/netty.png" /><span> Netty</span></a></li> <li><a href="https://dovecot.org/" ><img src="images/logo50/dovecot.png" /><span> dovecot</span></a></li> <li><a href="https://www.virtualhere.com/" ><img src="images/logo50/virtualhere.png" /><span> virtualHere</span></a></li> <li><a href="http://www.linbit.com/" ><img src="images/logo50/linbitW90.png" /><span> linBit</span></a></li> <li><a href="http://www.embulk.org/" ><img src="images/logo50/embulk.png" /><span> Embulk</span></a></li> <li><a href="https://neomutt.org/" ><img src="images/logo50/neomutt.png" /><span> NeoMutt</span></a></li> </ul> </div> #### Storage <div id="lz4usedby" class="container"> <ul id="icons" class="list-inline"> <li><a href="https://www.freenas.org/" ><img src="images/logo50/freenas.png" /><span> freeNAS</span></a></li> <li><a href="https://www.datastax.com/" ><img src="images/logo50/datastax.png" /><span> DataStax</span></a></li> <li><a href="https://www.hybrid-san.co.uk/" ><img src="images/logo50/nimblestorage.png" /><span> Nimble Storage</span></a></li> <li><a href="https://www.nexenta.com/" ><img src="images/logo50/nexenta.png" /><span> Nexenta</span></a></li> <li><a href="https://kaminario.com/flash-array/"><img src="images/logo50/k2spear.png" /><span> K2 Spear</span></a></li> <li><a href="https://syneto.net/" ><img src="images/logo50/syneto.png" /><span> Syneto OS</span></a></li> <li><a href="http://quadstor.com/" ><img src="images/logo50/quadstor.png" /><span> QuadStor</span></a></li> <li><a href="https://github.com/dm-vdo/vdo" ><img src="images/logo50/placeholder.png" /><span> VDO</span></a></li> </ul> </div> #### Caching <div id="lz4usedby" class="container"> <ul id="icons" class="list-inline"> <li><a href="https://en.wikipedia.org/wiki/ZRam"><img src="images/logo50/linux.png" /><span> Zram</span></a></li> <li><a href="https://hhvm.com/" ><img src="images/logo50/hhvm.png" /><span> HHVM</span></a></li> <li><a href="http://kripken.github.io/emscripten-site/"><img src="images/logo50/emscripten.png"/><span> Emscripten</span></a></li> <li><a href="https://www.zend.com/" ><img src="images/logo50/zend.png" /><span> PHP Zend Optimizer</span></a></li> <li><a href="https://github.com/mbitsnbites/buildcache#buildcache-"><img src="images/logo50/buildcache.png"/><span> BuildCache</span></a></li> </ul> </div> ### Hardware <div id="lz4-hardware" class="container"> <ul id="icons" class="list-inline"> <li><a href="https://github.com/Xilinx/Vitis_Libraries/tree/master/data_compression/L2/tests/lz4_compress"><img src="images/logo50/xilinx.png"/><span> Xilinx FPGA</span></a></li> </ul> </div> #### Other <div id="lz4usedby" class="container"> <ul id="icons" class="list-inline"> <li><a href="https://www.mozilla.org/" ><img src="images/logo50/firefox.png" /><span> Mozilla Firefox</span></a></li> <li><a href="https://subversion.apache.org/" ><img src="images/logo50/svn.png" /><span> SVN</span></a></li> <li><a href="https://bitbucket.org/facebook/lz4revlog"><img src="images/logo50/fb-mercurial.png"/><span> Facebook's Mercurial</span></a></li> <li><a href="https://www.bareos.org/en/" ><img src="images/logo50/bareos.png" /><span> Bareos</span></a></li> <li><a href="https://gtkwave.sourceforge.net/" ><img src="images/logo50/gtkwave.png" /><span> GTKWave</span></a></li> <li><a href="https://www.blosc.org/" ><img src="images/logo50/placeholder.png" /><span> Blosc</span></a></li> <li><a href="https://github.com/ptaoussanis/nippy" ><img src="images/logo50/placeholder.png" /><span> Nippy</span></a></li> <li><a href="https://www.freedesktop.org/wiki/Software/systemd"><img src="images/logo50/freedesktop.png"/><span> systemd</span></a></li> <li><a href="http://zhengxwen.github.io/gdsfmt/" ><img src="images/logo50/bioconductor50.png"/><span> gdsfmt</span></a></li> <li><a href="https://www.rarelogic.com/" ><img src="images/logo50/rarelogic.png" /><span> Rarelogic</span></a></li> <li><a href="http://logscape.com/" ><img src="images/logo50/logscape.png" /><span> Logscape</span></a></li> <li><a href="https://github.com/funcodeio/lz4.vim" ><img src="images/logo50/placeholder.png" /><span> vim editor</span></a></li> <li><a href="https://iotic-labs.com/" ><img src="images/logo50/iotic.png" /><span> Iotic Labs</span></a></li> <li><a href="http://www.fstpackage.org/" ><img src="images/logo50/fst.png" /><span> FST</span></a></li> <li><a href="https://asdf.readthedocs.io/en/latest/#"><img src="images/logo50/astropy.png" /><span> ASDF</span></a></li> </ul> </div> ### Special Thanks to [Takayuki Matsuoka](https://github.com/t-mat/) who greatly contributed to the creation of this LZ4 webpage ---