Support Ukraine πŸ‡ΊπŸ‡¦ Help Provide Humanitarian Aid to Ukraine .
<a name="intro-video"></a> ## Watch Introductory Video <div> <iframe width="560" height="315" src="" title="Explain Like I'm 5: ZSTD" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowFullScreen ></iframe> </div> <a name="benchmarks"></a> Benchmarks ---------- For reference, several fast compression algorithms were tested and compared on a server running Arch Linux (`Linux version 5.5.11-arch1-1`), with a Core i9-9900K CPU @ 5.0GHz, using [lzbench], an open-source in-memory benchmark by @inikep compiled with [gcc] 9.3.0, on the [Silesia compression corpus]. [lzbench]: [Silesia compression corpus]: [gcc]: | Compressor name | Ratio | Compression| Decompress.| | --------------- | ------| -----------| ---------- | | **zstd 1.4.5 -1** | 2.884 | 500 MB/s | 1660 MB/s | | [zlib] 1.2.11 -1 | 2.743 | 90 MB/s | 400 MB/s | | brotli 1.0.7 -0 | 2.703 | 400 MB/s | 450 MB/s | | **zstd 1.4.5 --fast=1** | 2.434 | 570 MB/s | 2200 MB/s | | **zstd 1.4.5 --fast=3** | 2.312 | 640 MB/s | 2300 MB/s | | quicklz 1.5.0 -1 | 2.238 | 560 MB/s | 710 MB/s | | **zstd 1.4.5 --fast=5** | 2.178 | 700 MB/s | 2420 MB/s | | lzo1x 2.10 -1 | 2.106 | 690 MB/s | 820 MB/s | | [lz4] 1.9.2 | 2.101 | 740 MB/s | 4530 MB/s | | lzf 3.6 -1 | 2.077 | 410 MB/s | 860 MB/s | | snappy 1.1.8 | 2.073 | 560 MB/s | 1790 MB/s | [zlib]: [lz4]: The negative compression levels, specified with `--fast=#`, offer faster compression and decompression speed in exchange for some loss in compression ratio compared to level 1, as seen in the table above. Zstd can trade compression speed for stronger compression ratios. It is configurable by small increment. Decompression speed is preserved and remain roughly the same at all settings, a property shared by most LZ compression algorithms, such as [zlib] or lzma. The following tests were run on a server running Linux Debian (`Linux version 4.14.0-3-amd64`) with a Core i7-6700K CPU @ 4.0GHz, using [lzbench], an open-source in-memory benchmark by @inikep compiled with [gcc] 7.3.0, on the [Silesia compression corpus]. | Compression Speed vs Ratio | Decompression Speed | | ---------------------------|-------------------- | | <img src="" alt="Compression Speed vs Ratio" style="height:500px;"> | <img src="" alt="Decompression Speed" style="height:500px;"> Several algorithms can produce higher compression ratio but at slower speed, falling outside of the graph. For a larger picture including very slow modes, [click on this link]( . <a name="small-data"></a> ### The case for Small Data compression Previous charts provide results applicable to typical file and stream scenarios (several MB). Small data comes with different perspectives. The smaller the amount of data to compress, the more difficult it is to compress. This problem is common to all compression algorithms, and reason is, compression algorithms learn from past data how to compress future data. But at the beginning of a new data set, there is no "past" to build upon. To solve this situation, Zstd offers a __training mode__, which can be used to tune the algorithm for a selected type of data. Training Zstandard is achieved by provide it with a few samples (one file per sample). The result of this training is stored in a file called "dictionary", which must be loaded before compression and decompression. Using this dictionary, the compression ratio achievable on small data improves dramatically. The following example uses the `github-users` [sample set](, created from [github public API]( It consists of roughly 10K records weighting about 1KB each. Compression Ratio | Compression Speed | Decompression Speed ------------------|-------------------|-------------------- ![Compression Ratio]( "Compression Ratio") | ![Compression Speed]( "Compression Speed") | ![Decompression Speed]( "Decompression Speed") These compression gains are achieved while simultaneously providing _faster_ compression and decompression speeds. Training works if there is some correlation in a family of small data samples. The more data-specific a dictionary is, the more efficient it is (there is no _universal dictionary_). Hence, deploying one dictionary per type of data will provide the greatest benefits. Dictionary gains are mostly effective in the first few KB. Then, the compression algorithm will gradually use previously decoded content to better compress the rest of the file. ### A rich API set : Zstandard API is designed with learning curve in mind. At the top, you'll find simple methods, using trivial arguments and behavior. Then, at each new paragraph, the API introduces new concepts and parameters, giving gradually more control for advanced usages. You can learn more about Zstandard API by reading [its documentation]( <br/> <a name="other-languages"></a> ## Multiple programming languages Should you need Zstandard in different language than [reference C], here is a list of known bindings and ports provided by great authors. All versions support the Zstandard [format specification] and are therefore interoperable. Many versions listed below are bindings to the [reference C] library. There are also full re-implementation of the algorithm in the target language which are explicitly labelled as Ports. | Language | Author | URL | | ------------- | ------------------- | ------------------------------------- | | __Java__ | Luben Karavelov | | | __Java__ (Port) | Martin Traverso | | __Python__ (full) | Gregory Szorc | | __Python__ (simple) | Sergey Dryabzhinsky | | __Python__ (bz2 api) | Ma Lin | | | __Rust__ | Alexandre Bury | | | __Rust__ (decoder, Port) | Moritz Borcherding | | __C#__ | SKB Kontur | | | __C#__ (streaming) | Bernhard Pichler | | __C#__ (signed) | Tyler Young | | __C#__ (Port) | Oleg Stepanischev | | __Javascript__ (emscripten) | Yoshihito | | __Javascript__ (decoder, Port) | Arjun Barrett | | __Node.js__ streams | albertdb | | __Node.js__ buffers | Zwb | | __PHP__ | Kamijo | | | __R__ | Konstantin Sorokin | | __Go__ (Port) | Klaus Post | | __Go__ | Vianney Tran | | | __Go__ (+dict) | Aliaksandr Valialkin | | | __Swift__ | Anatoli Peredera | | | __Ruby__ | SpringMT | | | __Ruby__ (FFI) | Michael Sievers | | __Ruby__ (stream) | Andrew Aladjev | | | __Perl__ | Jiro Nishiguchi | | __Pascal__ | Denis Anisimov | | __Visual Basic 6__ | Tanner Helland | | __Objective C__ | Micha Mazaheri | | __Lisp__ | Guillaume Le Vaillant | | | __Ada__ | John Marino | | | __Dart__ | Instantiations | | __Scala__ (Port, decoder) | Johannes Rudolph | | __Julia__ | Kenta Sato | | __D__ | Masahiro Nakagawa | | | __Lua__ | Soojin Nam | | __Haskell__ | Bryan O'Sullivan | | __Erlang__ | Yuki Ito | | | __Tcl__ | D. Bohdan | | | __SmallTalk__ | Instantiations | | __Elixir__ | chenzhuoyu | | | __OCaml__ | Jane Street | | __Crystal__ | @didactic-drunk | | __Nim__ | wltsmrz | | | __Racket__ | Vincent Lee | | [reference C]: [format specification]: <br/> <a name="GUI"></a> ## Graphical User Interfaces Tino Reichardt has created a version of [7-zip archive manager with Zstandard]( Denis Anisimov, of TC4shell fame, also developed a [7-zip plugin with Zstandard support]( Peazip is a free multi-platforms archiver by Giorgio Tani with [support for Zstandard]( [WinRAR]( supports decoding of Zstandard files (as well as zip files using Zstandard encoder) <img src="images/7-Zip_02.png" alt="7-zip with Zstandard" style="height:400px;"> <br/> <a name="references"></a> ## Zstandard is used by : #### Featured <div class="container"> <ul class="list-inline"> <li><a href="" ><img src="images/linux.png" /></a> [Linux]( </li> <li><a href="" ><img src="images/freebsd.png" /></a> [FreeBSD](</li> <li><a href="" ><img src="images/aws.png" /></a> [Redshift]( </li> <li><a href="" ><img src="images/github.png" /></a> [Github Actions](</li> <li><a href="" ><img src="images/mercurial.png"/></a> [Mercurial](</li> </ul> </div> #### Databases <div class="container"> <ul class="list-inline"> <li><a href="" ><img src="images/rocksdb.png" /></a> [RocksDB]( </li> <li><a href="" ><img src="images/hadoop.png" /></a> [Hadoop]( </li> <li><a href="" ><img src="images/mysql.png" /></a> [MySQL]( </li> <li><a href="" ><img src="images/cassandra.png"/></a> [Cassandra]( </li> <li><a href="" ><img src="images/mongo.png" /></a> [MongoDB]( </li> <li><a href="" ><img src="images/wt.png" /></a> [WiredTiger]( </li> <li><a href="" ><img src="images/redis.png" /></a> [Redis]( </li> <li><a href="" ><img src="images/presto.png" /></a> [Presto]( </li> <li><a href="" ><img src="images/clickhouse.png"/></a> [ClickHouse]( </li> <li><a href="" ><img src="images/groonga.png" /></a> [Groonga]( </li> <li><a href="" ><img src="images/tarantool.png"/></a> [Tarantool]( </li> <li><a href="" ><img src="images/tokudb.png" /></a> [TokuDB]( </li> <li><a href="" ><img src="images/hbase.png" /></a> [HBase]( </li> <li><a href="" ><img src="images/postgresql.png"/></a> [PostgreSQL]( </li> <li><a href=""><img src="images/victoriametrics.png"/></a> [VictoriaMetrics]( </li> <li><a href="" ><img src="images/scylla.png" /></a> [Scylla]( </li> <li><a href="" ><img src="images/vertica.png" /></a> [Vertica]( </li> <li><a href="" ><img src="images/impala.png" /></a> [Impala]( </li> </ul> </div> #### File systems & storage <div class="container"> <ul class="list-inline"> <li><a href=""><img src="images/btrfs.png"/></a> [BtrFS]( </li> <li><a href=""><img src="images/openzfs.png"/></a> [OpenZFS]( </li> <li><a href=""><img src="images/squashfs.png"/></a> [SquashFS]( </li> <li><a href=""><img src="images/f2fs.png" /></a> [F2FS]( </li> <li><a href=""><img src="images/reiserfs.png"/></a> [ReiserFS]( </li> <li><a href="" ><img src="images/truenas.png"/></a> [TrueNAS](</li> </ul> </div> #### Web <div class="container"> <ul class="list-inline"> <li><a href="" ><img src="images/caddy.png" /></a> [caddy]( </li> <li><a href="" ><img src="images/hhvm.png" /></a> [HHVM]( </li> <li><a href=""><img src="images/nginx.png"/></a> [nginx (module)]( </li> <li><a href="" ><img src="images/curl.png" /></a> [curl]( </li> <li><a href="" ><img src="images/wget2.png" /></a> [wget2]( </li> <li><a href="" ><img src="images/django.png" /></a> [django]( </li> <li><a href="" ><img src="images/htoolkit.png"/></a> [HTTP Toolkit]( </li> </ul> </div> #### Archives <div class="container"> <ul class="list-inline"> <li><a href="" ><img src="images/winzip.png" /></a> [winzip]( </li> <li><a href="" ><img src="images/winrar.png" /></a> [winrar]( </li> <li><a href="" ><img src="images/powerarc.png"/></a> [PowerAchiver]( </li> <li><a href="" ><img src="images/fog.png" /></a> [Fog]( </li> <li><a href=""><img src="images/borg50.png"/></a> [Backup]( </li> <li><a href="" ><img src="images/libarchive.png"/></a> [libarchive]( </li> <li><a href=""><img src="images/gnu.png" /></a> [tar]( </li> <li><a href=""><img src="images/smvicon.png"/></a> [SmartVersion]( </li> </ul> </div> #### Serialization <div class="container"> <ul class="list-inline"> <li><a href="" ><img src="images/fst.png" /></a> [FST]( </li> <li><a href="" ><img src="images/blosc.png" /></a> [Blosc]( </li> <li><a href=""><img src="images/bcolz.png" /></a> [bcolz]( </li> <li><a href="" ><img src="images/apache-arrow.png"/></a> [Apache Arrow]( </li> <li><a href=""><img src="images/mrc.png" /></a> [mrcz]( </li> <li><a href=""><img src="images/oxford.png" /></a> [bgen]( </li> <li><a href=""><img src="images/gecko.png" /></a> [Gecko]( </li> <li><a href=""><img src="images/hdf.png" /></a> [HDF5]( </li> <li><a href="" ><img src="images/sereal.png" /></a> [Sereal]( </li> <li><a href=""><img src="images/hulon.png"/></a> [PLink2]( </li> <li><a href=""><img src="images/naf.png" /></a> [NAF]( </li> </ul> </div> #### Network <div class="container"> <ul class="list-inline"> <li><a href=""><img src="images/thrift.png"/></a> [fbthrift]( </li> <li><a href=""><img src="images/fizz.png"/></a> [Fizz]( </li> <li><a href=""><img src="images/proxygen.png"/></a> [proxygen]( </li> <li><a href=""><img src="images/mcrouter.png"/></a> [mcrouter]( </li> <li><a href="" ><img src="images/rspamd.png" /></a> [Rspamd]( </li> <li><a href="" ><img src="images/tor.png" /></a> [Tor]( </li> <li><a href="" ><img src="images/neomutt.png" /></a> [NeoMutt]( </li> <li><a href=""><img src="images/rsync.png"/></a> [Rsync]( </li> </ul> </div> #### Hardware <div class="container"> <ul class="list-inline"> <li><a href=""><img src="images/xilinx.png"/></a> [Xilinx]( </li> <li><a href="" ><img src="images/inaccel.png" /></a> [Inaccel]( </li> <li><a href=""><img src="images/ibm.png"/></a> [IBM TS7700]( </li> </ul> </div> #### Games & Creation <div class="container"> <ul class="list-inline"> <li><a href="" ><img src="images/lol.png " /></a> [League of Legends]( </li> <li><a href="" ><img src="images/blender.png" /></a> [Blender]( </li> <li><a href="" ><img src="images/godot.png" /></a> [Godot]( </li> <li><a href=""><img src="images/ktx.png"/></a> [Khronos's KTX]( </li> <li><a href=""><img src="images/siv3d.png" /></a> [OpenSiv3D]( </li> <li><a href="" ><img src="images/esenthel.png" /></a> [Esenthel]( </li> <li><a href="" ><img src="images/andromeda.png"/></a> [Mass Effect:Andromeda]( </li> </ul> </div> #### Misc <div class="container"> <ul class="list-inline"> <li><a href="" ><img src="images/ubuntu.png" /></a> [Ubuntu]( </li> <li><a href="" ><img src="images/fedora.png" /></a> [Fedora]( </li> <li><a href="" ><img src="images/arch.png" /></a> [ArchLinux]( </li> <li><a href="" ><img src="images/rpm.png" /></a> [RPM]( </li> <li><a href="" ><img src="images/freebsd.png" /></a> [PKG]( </li> <li><a href="" ><img src="images/conda.png" /></a> [Conda]( </li> <li><a href="" ><img src="images/gcc.png" /></a> [GCC]( </li> <li><a href=""><img src="images/folly.png"/></a> [folly]( </li> <li><a href="" ><img src="images/cmake.png" /></a> [cmake]( </li> <li><a href="" ><img src="images/taskc2.png" /></a> [TaskCluster](</li> <li><a href="" ><img src="images/uppframe.png"/></a> [U++]($uppweb$Roadmap$en-us.html) </li> <li><a href="" ><img src="images/ceph.png" /></a> [Ceph](</li> <li><a href=""><img src="images/blank.png"/></a> [LiveScan3D]( </li> <li><a href="" ><img src="images/kiwix.png" /></a> [Kiwix]( </li> </ul> </div> <br/> --- <div className="footerSection"> <h7>Legal</h7> <a href="" target="_blank" rel="noreferrer noopener"> Privacy </a> <a href="" target="_blank" rel="noreferrer noopener"> Terms </a> </div>