<a id="benchmarks"></a> Benchmarks ------------------------- These measurements were performed in August 2020. The reference system uses an Intel i7-9700K cpu, and runs Ubuntu x64 20.04. The [open source benchmark program] is compiled with `clang` v10.0 using `-O3` flag. Bandwidth tests are measured on a 100 KB input, which stays in CPU cache. The _memcpy_ reference, in contrast, is measured from RAM. It shows that some algorithms can process data faster than RAM can deliver it, so hash is no longer the bottleneck. _Small data velocity_ is a _rough_ evaluation of an algorithm's efficiency on small inputs; see [the wiki](https://github.com/Cyan4973/xxHash/wiki/Performance-comparison#benchmarks-concentrating-on-small-data-) for a detailed analysis. | Hash Name | Width | Bandwidth (GB/s) | Small Data Velocity | Quality | Comment | | --------- | ----- | ---------------- | ----- | --- | --- | | __XXH3__ (AVX2) | 64 | 59.4 GB/s | 133.1 | 10 | AVX2 support (optional) | __XXH128__ (AVX2) | 128 | 57.9 GB/s | 118.1 | 10 | AVX2 support (optional) | __XXH3__ (SSE2) | 64 | 31.5 GB/s | 133.1 | 10 | | __XXH128__ (SSE2) | 128 | 29.6 GB/s | 118.1 | 10 | | _memcpy (from RAM)_| N/A | 28.0 GB/s | N/A | N/A | _from RAM, for reference_ | City64 | 64 | 22.0 GB/s | 76.6 | 10 | | T1ha2 | 64 | 22.0 GB/s | 99.0 | 9 | Slightly worse [collisions] | City128 | 128 | 21.7 GB/s | 57.7 | 10 | | __XXH64__ | 64 | 19.4 GB/s | 71.0 | 10 | | SpookyHash | 64 | 19.3 GB/s | 53.2 | 10 | | Mum | 64 | 18.0 GB/s | 67.0 | 9 | Slightly worse [collisions] | __XXH32__ | 32 | 9.7 GB/s | 71.9 | 10 | | City32 | 32 | 9.1 GB/s | 66.0 | 10 | | Murmur3 | 32 | 3.9 GB/s | 56.1 | 10 | | SipHash | 64 | 3.0 GB/s | 43.2 | 10 | | FNV64 | 64 | 1.2 GB/s | 62.7 | 5 | Poor avalanche properties | Blake2 | 256 | 1.1 GB/s | 5.1 | 10 | Cryptographic | SHA1 | 160 | 0.8 GB/s | 5.6 | 10 | Cryptographic but broken | MD5 | 128 | 0.6 GB/s | 7.8 | 10 | Cryptographic but broken [open source benchmark program]: https://github.com/Cyan4973/xxHash/tree/release/tests/bench [collisions]: https://github.com/Cyan4973/xxHash/wiki/Collision-ratio-comparison#collision-study note: On 32-bit applications, the ranking between hashes differs drastically, strongly favoring 32-bit hashes, See [this section of the wiki](https://github.com/Cyan4973/xxHash/wiki/Performance-comparison#bandwidth-on-x86-with-various-data-size-of-len-2n-32-bit-friendliness) for illustration. ### Bandwidth per platform <ul class="nav nav-tabs" id="platform-tabs"> <li><a href="#" data-platform="Intel i7-9700K">Intel i7-9700K</a></li> <li><a href="#" data-platform="Apple M1 Pro">Apple M1 Pro</a></li> <li><a href="#" data-platform="AMD Zen 5">AMD Zen 5</a></li> </ul> |Platform |Variant |Bandwidth |-- |-- |-- |Intel i7-9700K |__XXH3__ (AVX2) |59.4 GB/s |Intel i7-9700K |__XXH128__ (AVX2)|57.9 GB/s |Intel i7-9700K |__XXH3__ (SSE2) |31.5 GB/s |Intel i7-9700K |__XXH128__ (SSE2)|29.6 GB/s |Intel i7-9700K |_memcpy_ (from RAM)|28.0 GB/s |Intel i7-9700K |__XXH64__ |19.4 GB/s |Intel i7-9700K |__XXH32__ |9.7 GB/s |Apple M1 Pro |_memcpy_ (from RAM)|45 GB/s |Apple M1 Pro |__XXH3__ (NEON) |36.3 GB/s |Apple M1 Pro |__XXH128__ (NEON)|35.1 GB/s |Apple M1 Pro |__XXH64__ |13.4 GB/s |Apple M1 Pro |__XXH32__ |6.6 GB/s |AMD Zen 5 |__XXH3__ (AVX512)|159 GB/s |AMD Zen 5 |__XXH128__ (AVX512)|156 GB/s |AMD Zen 5 |__XXH3__ (AVX2) |84.0 GB/s |AMD Zen 5 |__XXH128__ (AVX2)|83.5 GB/s |AMD Zen 5 |__XXH3__ (SSE2) |38.9 GB/s |AMD Zen 5 |__XXH128__ (SSE2)|37.4 GB/s |AMD Zen 5 |_memcpy_ (from RAM)|28.5 GB/s |AMD Zen 5 |__XXH64__ |27.8 GB/s |AMD Zen 5 |__XXH32__ |13.8 GB/s <br/> <a id="other-languages"></a> ## Multiple languages The following versions produce xxHash-compatible results in different languages. To write one yourself, follow the [format specification]. [format specification]: https://github.com/Cyan4973/xxHash/blob/dev/doc/xxhash_spec.md <!-- Rows are sorted alphabetically on the language label, as written. A language's own variants keep their existing relative order. Shells and assembly go in the separate table further below. --> |Language |Author |URL |-- |-- |-- |__C__ multithreaded |Shawn Bayern |https://github.com/shawnbayern/xxHash |__C#__ (std pkg) |Microsoft |https://learn.microsoft.com/en-us/dotnet/api/system.io.hashing?view=net-9.0-pp |__C#__ (port) |Melnik Alexander |https://github.com/uranium62/xxHash |__C#__ (.net std 2.0) |Sedat Kapanoğlu |https://github.com/ssg/HashDepot#xxhash |__C++__ (simple) |Stefan Brumme |https://create.stephan-brumme.com/xxhash/ |__C++__ constexpr (XXH64) |Daniel Kirchner |https://github.com/ekpyron/xxhashct |__C++__ constexpr (XXH32) |Takayuki Matsuoka |https://github.com/Cyan4973/xxHash/issues/496 |__C++__ constexpr (XXH3) |chys87 |https://github.com/chys87/constexpr-xxh3 |__C++ 17__ |Red Gavin |https://github.com/RedSpah/xxhash_cpp |__Crystal__ |Lucjan Suski |https://github.com/methyl/xxhash |__D__ |Masahiro Nakagawa |https://github.com/repeatedly/xxhash-d |__Dart__ (XXH3) |SamJakob |https://pub.dev/packages/xxh3 |__Elixir__ (nif) |Ali Farhadi |https://github.com/farhadi/xxh3 |__Elixir__ (port) |Mykola Konyk |https://github.com/ttvd/elixir-xxhash |__Erlang__ |Pierre Matri |https://github.com/pierresforge/erlang-xxhash |__Erlang__ (XXH3) |Ali Farhadi |https://github.com/farhadi/xxh3 |__Go__ (XXH64) |Ahmed Waheed |https://github.com/OneOfOne/xxhash |__Go__ (XXH3) |Jeff Wendling |https://github.com/zeebo/xxh3 |__Go + ASM__ |Caleb Spare |https://github.com/cespare/xxhash |__Haskell__ |Henri Verroken |http://hackage.haskell.org/package/xxhash-ffi |__Haskell__ (port) |Christian Marie |http://hackage.haskell.org/package/xxhash |__Java__ |Adrien Grand |https://github.com/lz4/lz4-java/tree/master/src/java/net/jpountz/xxhash |__Java__ (all, port) |Dynatrace |https://github.com/dynatrace-oss/hash4j/blob/main/src/main/java/com/dynatrace/hash4j/hashing/XXH3_64.java |__Java__ (XXH3, XXH128) |James Z.M. Gao |https://github.com/OpenHFT/Zero-Allocation-Hashing/blob/master/src/main/java/net/openhft/hashing/XXH3.java |__JavaScript__ (WebAssembly)|Michael Jungo |https://www.npmjs.com/package/xxhash-wasm |__JavaScript__ (port) |Pierre Curto |https://npmjs.org/package/xxhashjs |__JavaScript__ (nodeJS) |Brian White |https://npmjs.org/package/xxhash |__JavaScript__ (nodeJS, xxh3)|Nhan Khong |https://github.com/ktrongnhan/xxhash-addon |__JavaScript__ (React Native)|Alex Shumihin |https://github.com/pioner92/react-native-xxhash |__JSX__ (static JavaScript)|Yoshiki Shibukawa |https://www.npmjs.org/package/xxhash.jsx |__Julia__ |Hanan Rosemarin |https://github.com/hros/XXhash.jl |__Kotlin__ |Matthew Dolan |https://github.com/appmattus/crypto/tree/main/cryptohash |__Lua__ (binding) |Masatoshi Teruya |https://github.com/mah0x211/lua-xxhash |__Lua__ (jit, XXH32) |szensk |https://github.com/szensk/luaxxhash |__Lua__ (jit, XXH64) |Soojin Nam |https://github.com/sjnam/luajit-xxHash |__OCaml__ |Pieter Goetschalckx|http://opam.ocaml.org/packages/xxhash/ |__Pascal__ |Vojtěch Čihák |http://sourceforge.net/projects/xxhashfpc |__Perl__ |Sanko Robinson |https://metacpan.org/module/Digest::xxHash |__Perl__ (streaming) |Bela Bodecs |https://github.com/DoubleBB/digest-xxhash64 |__PHP__ |Nir Heimann |https://github.com/nheimann1/php-xxhash |__PHP__ (port) |Scott Dutton |https://github.com/exussum12/xxhash |__PHP7__ |Craig R Megasaxon |https://github.com/Megasaxon/php-xxhash |__PHP8__ |Anatol Belski |https://php.watch/versions/8.1/xxHash |__PicoLisp__ |mpech |https://git.envs.net/mpech/xxhash-picolisp |__Python__ |Yue Du |https://pypi.python.org/pypi/xxhash/ |__R__ |Dirk Eddelbuettel |https://github.com/eddelbuettel/digest |__R__ (XXH3) |mikefc |https://github.com/coolbutuseless/xxhashlite |__Ruby__ (port) |Justin W Smith |http://rubygems.org/gems/ruby-xxHash |__Ruby__ (wrapper) |Vasiliy Ermolovich |https://rubygems.org/gems/xxhash |__Ruby__ (digest::class) |konsolebox |https://rubygems.org/gems/digest-xxhash |__Rust__ |Jake Goulding |https://libraries.io/cargo/twox-hash |__Rust__ (const xxh3) |Arthur Martirosyan |https://crates.io/crates/xxhash-rust |__Scala__ |Desmond Yeung |https://github.com/desmondyeung/scala-hashing |__Swift__ |Daisuke T |https://github.com/daisuke-t-jp/xxHash-Swift |__Tcl__ (XXH32, port) |D. Bohdan |https://wiki.tcl-lang.org/48790 |__Zig__ |ziglang |https://github.com/Cyan4973/xxHash/issues/1001 #### Shells and assembly |Language |Author |URL |-- |-- |-- |__Bash__ (port) |Devin Hussey |https://github.com/easyaspi314/xxbash |__Batch__ (XXH32, port) |Antonio Aacini |https://github.com/Aacini/xxHash32 |__sh__ (port) |Jan Chren |https://gitlab.com/rindeal/xxHashish |__x86 assembly__ (XXH32) |Antonio Aacini |https://github.com/Aacini/xxHash32 <br/> <a id="references"></a> ## xxHash is used by #### Systems &amp; Infrastructure <div id="xxhashusedby_systems" class="container"> <ul class="list-inline"> <li><a href="https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=59e1a2f4bf83744e748636415fde7d1e9f557e05"><img src="images/logo50/linux.png"/> Linux</a></li> <li><a href="https://docs.microsoft.com/en-us/azure/kusto/query/hashfunction"><img src="images/logo50/azure50.png"/> Microsoft Azure</a></li> <li><a href="https://www.qemu.org/"><img src="images/logo50/qemu.png"/> Qemu</a></li> <li><a href="https://btrfs.wiki.kernel.org/index.php/Main_Page"><img src="images/logo50/btrfs.png"/> btrfs</a></li> <li><a href="https://wiki.freebsd.org/pkgng"><img src="images/logo50/freebsd.png"/> PKG</a></li> <li><a href="https://forum.huawei.com/enterprise/en/how-to-understand-inline-deduplication-and-compression/thread/604642-891"><img src="images/logo50/huawei.png"/> Dorado</a></li> </ul> </div> #### Databases <div id="xxhashusedby_databases" class="container"> <ul class="list-inline"> <li><a href="http://prestodb.io/"><img src="images/logo50/prestoDB.png"/> PrestoDB</a></li> <li><a href="https://rocksdb.org/"><img src="images/logo50/rocksdb.png"/> RocksDB</a></li> <li><a href="https://www.mysql.com/"><img src="images/logo50/mysql.png"/> MySQL</a></li> <li><a href="https://clickhouse.com/"><img src="images/logo50/clickhouse.png"/> ClickHouse</a></li> <li><a href="https://www.arangodb.org/"><img src="images/logo50/arangoDB.png"/> ArangoDB</a></li> <li><a href="https://pgroonga.github.io/"><img src="images/logo50/pgroonga.png"/> PGroonga</a></li> <li><a href="http://spark.apache.org/"><img src="images/logo50/spark.png"/> Spark</a></li> <li><a href="https://mariadb.org/"><img src="images/logo50/mariadb.png"/> MariaDB</a></li> <li><a href="https://groonga.org/docs/news.html#release-10-0-8"><img src="images/logo50/groonga.png"/> Groonga</a></li> </ul> </div> #### Games <div id="xxhashusedby_games" class="container"> <ul class="list-inline"> <li><a href="https://youtu.be/DkspHgt27Io?t=717"><img src="images/logo50/CoD_BO_CW.png"/> CoD Black Ops</a></li> <li><a href="https://mafiagame.fandom.com/wiki/Mafia:_Definitive_Edition_Credits"><img src="images/logo50/mafiade.png"/> Mafia</a></li> <li><a href="https://www.minecraft.net"><img src="images/logo50/minecraft.png"/> Minecraft</a></li> <li><a href="https://ppsspp.org/"><img src="images/logo50/ppsspp.png"/> PPSSPP</a></li> <li><a href="https://dolphin-emu.org/"><img src="images/logo50/dolphin.png"/> Dolphin</a></li> <li><a href="https://cxbx-reloaded.co.uk"><img src="images/logo50/cxbx.png"/> Cxbx-reloaded</a></li> <li><a href="http://www.cocos2d.org/"><img src="images/logo50/cocos2D.png"/> Cocos2D</a></li> <li><a href="https://www.lwjgl.org/"><img src="images/logo50/lwjgl.png"/> LWJGL</a></li> <li><a href="https://codeberg.org/Heathen-Engineering/O3DE-xxHash"><img src="images/logo50/heathen.png"/> O3DE Gem</a></li> <li><a href="http://fc-solve.shlomifish.org/">Freecell Solver</a></li> </ul> </div> #### Filters <div id="xxhashusedby_filters" class="container"> <ul class="list-inline"> <li><a href="https://www.haproxy.org/"><img src="images/logo50/haproxy.png"/> HAProxy</a></li> <li><a href="https://rspamd.com/"><img src="images/logo50/rspamd.png"/> Rspamd</a></li> <li><a href="https://www.pfsense.org/"><img src="images/logo50/pfsense.png"/> pfSense</a></li> <li><a href="http://freecode.com/projects/fio/"><img src="images/logo50/placeholder.png"/> fio</a></li> <li><a href="https://npmjs.org/package/bloomxx/"><img src="images/logo50/placeholder.png"/> bloomxx</a></li> <li><a href="http://devisedbydavid.com/open_source/bloom_filter"><img src="images/logo50/placeholder.png"/> C & Python Bloom Filter</a></li> <li><a href="https://github.com/mozilla-services/lua_bloom_filter"><img src="images/logo50/mozilla.png"/> LUA Bloom Filter</a></li> </ul> </div> #### File Transfer <div class="container"> <ul class="list-inline"> <li><a href="https://partnerhelp.netflixstudios.com/hc/en-us/articles/360000581207-Production-Assets-Data-Management"><img src="images/logo50/netflix.png"/> Netflix</a></li> <li><a href="https://rsync.samba.org/"><img src="images/logo50/rsync.png"/> rsync</a></li> <li><a href="http://www.lz4.org/"><img src="images/logo50/lz4.png"/> LZ4</a></li> <li><a href="https://pomfort.com/silverstack/"><img src="images/logo50/silverstack.png"/> Silverstack</a></li> <li><a href="http://www.lespace.co.jp/file_bl/rapidcopy/rapidcopy.html"><img src="images/logo50/rapidcopy.png"/> Rapidcopy</a></li> <li><a href="https://www.hedgeformac.com/"><img src="images/logo50/syncFactory.png"/> Hedge</a></li> <li><a href="https://ipmsg.org/tools/fastcopy.html.en"><img src="images/logo50/fastcopy.png"/> fastcopy</a></li> <li><a href="https://codesector.com/teracopy"><img src="images/logo50/teracopy.png"/> TeraCopy</a></li> <li><a href="https://www.dragonflybsd.org/hammer/"><img src="images/logo50/hammer.png"/> Hammer 2</a></li> <li><a href="https://compressme.net/"><img src="images/logo50/chk48.png"/> CHK</a></li> </ul> </div> #### Other <div id="xxhashusedby_other" class="container"> <ul class="list-inline"> <li><a href="https://devblogs.microsoft.com/cppblog/linker-throughput-improvement-in-visual-studio-2019/"><img src="images/logo50/microsoft.png"/> Visual Studio</a></li> <li><a href="https://docs.nvidia.com/nsight-compute/CopyrightAndLicenses/index.html"><img src="images/logo50/nvidia.png"/> NSight compute</a></li> <li><a href="https://www.xpra.org/"><img src="images/logo50/xpra.png"/> Xpra</a></li> <li><a href="http://www.teamviewer.com/"><img src="images/logo50/teamviewer.png"/> TeamViewer</a></li> <li><a href="http://factorcode.org/"><img src="images/logo50/factor.png"/> Factor</a></li> <li><a href="http://nvlabs.github.io/nvbio/index.html"><img src="images/logo50/nvbio.png"/> nVBio</a></li> <li><a href="https://genozip.com/"><img src="images/logo50/placeholder.png"/> Genozip</a></li> <li><a href="http://dvisvgm.de/"><img src="images/logo50/placeholder.png"/> dvisvgm</a></li> <li><a href="http://www.fastbuild.org/"><img src="images/logo50/fastbuild.png"/> FastBuild</a></li> <li><a href="http://keypirinha.com/"><img src="images/logo50/keypirinha.png"/> Keypirinha</a></li> <li><a href="http://quickhash-gui.org/"><img src="images/logo50/quickhash.png"/> QuickHash</a></li> </ul> </div> ### Special Thanks to - [Takayuki Matsuoka](https://github.com/t-mat/) for creating `xxhsum -c` and the canvas of this webpage. - [Mathias Westerdahl](https://github.com/JCash) for introducing the first version of XXH64. - [Devin Hussey](https://github.com/easyaspi314) for the excellent low-level optimizations on XXH3 and XXH128. ---