Hash Benchmarks

January 18, 2026 ยท View on GitHub

Benchmarks for hashing functions across Rust and Python implementations.

Many great hashing libraries exist in Rust, C, and C++. Typical top choices are aHash, xxHash, blake3, gxhash, CityHash, MurmurHash, crc32fast, or the native std::hash. Many of them have similar pitfalls:

  • They are not always documented to have a certain reproducible output and are recommended for use only for local in-memory construction of hash tables, not for serialization or network communication.
  • They don't always support streaming and require the whole input to be available in memory at once.
  • They don't always pass the SMHasher test suite, especially with --extra checks enabled.
  • They generally don't have a dynamic dispatch mechanism to simplify shipping of precompiled software.
  • They are rarely available for multiple programming languages.

StringZilla addresses those issues and seems to provide competitive performance.

Single Hash

On Intel Sapphire Rapids CPU, on xlsum.csv dataset, the following numbers can be expected for hashing individual whitespace-delimited words and newline-delimited lines:

LibraryBitsPortsArmShort WordsLong Lines
Rust
std::hash64-+0.43 GB/s3.74 GB/s
crc32fast::hash32++0.49 GB/s8.45 GB/s
xxh3::xxh3_6464++1.08 GB/s9.48 GB/s
aHash::hash_one64-+1.23 GB/s8.61 GB/s
foldhash::hash_one64-+1.02 GB/s8.24 GB/s
gxhash::gxhash6464--2.68 GB/s9.19 GB/s
stringzilla::hash64++1.84 GB/s11.38 GB/s
Python
hash32/64-+0.13 GB/s4.27 GB/s
xxhash.xxh3_6464++0.04 GB/s6.38 GB/s
google_crc32c.value32++0.04 GB/s5.96 GB/s
mmh3.hash3232++0.05 GB/s2.65 GB/s
mmh3.hash6464++0.03 GB/s4.45 GB/s
cityhash.CityHash6464+-0.06 GB/s4.87 GB/s
stringzilla.hash64++0.14 GB/s9.19 GB/s

Ports means availability in multiple other programming languages, like C, C++, Python, Java, Go, JavaScript, etc. Arm indicates support for Arm architecture. Most hash functions work on both x86 and Arm, but gxHash and many MurMurHash and CityHash implementations don't.

Streaming Hash

In larger systems, we often need the ability to incrementally hash the data. This is especially important in distributed systems, where the data is too large to fit into memory at once.

LibraryBitsPortsShort WordsLong Lines
Rust
std::hash::DefaultHasher64-0.51 GB/s3.92 GB/s
aHash::AHasher64-1.30 GB/s8.56 GB/s
foldhash::FoldHasher64-1.27 GB/s8.18 GB/s
crc32fast::Hasher32+0.37 GB/s8.39 GB/s
stringzilla::Hasher64+0.89 GB/s11.03 GB/s
Python
xxhash.xxh3_6464+0.09 GB/s7.09 GB/s
google_crc32c.Checksum32+0.04 GB/s5.96 GB/s
stringzilla.Hasher64+0.35 GB/s6.04 GB/s

Checksum and Cryptographic Hashing

For reference, one may want to put those numbers next to check-sum calculation speeds on one end of complexity and cryptographic hashing speeds on the other end.

LibraryBitsPortsShort WordsLong Lines
Rust
stringzilla::bytesum64+2.16 GB/s11.65 GB/s
blake3::hash256+0.10 GB/s1.97 GB/s
Python
stringzilla.bytesum64+0.16 GB/s8.62 GB/s
blake3.digest256+0.02 GB/s1.82 GB/s

See README.md for dataset information and replication instructions.