ihash
The world's fastest high-quality non-cryptographic hash library.
Cross-platform consistent, with support for extensible output and addressable stream ciphers.
General-purpose non-cryptographic hashing commonly faces three categories of engineering trade-offs:
- Implementations that only pursue hash-table speed do not guarantee cross-architecture result consistency.
- Vector algorithms relying on in-page out-of-bounds reads are prone to triggering memory boundary-check warnings.
- Implementations targeting hardware instruction sets only cannot compile under WebAssembly or in environments without AES extensions.
ihash provides 32/64/128/256-bit prefix-consistent digests, arbitrary-length streaming key streams, and an 8-byte hash-table state, with boundary-safe reads at all lengths.
Output is bit-identical across x86_64, aarch64, the built-in scalar T-table fallback (soft.rs), and pure-CPU software SIMD (fearless_simd); supports #![no_std] and C ABI export.
Note: "High quality" as used in this article refers to the statistical quality of passing all 20 test suites of smhasher3: avalanche diffusion is met under minimal input changes, no anomalous collisions occur with sparse or patterned keys, and all items still pass when different seeds are substituted. This quality does not include cryptographic strength such as collision resistance. See Hash Quality for details.
- Performance Benchmark
- Usage
- Interface
- Feature Flags
- Extendable Output and Addressable Stream
- Capability Comparison and Selection Reference
- Hash Quality
- Design Principles
- Performance Benchmark Details
Performance Benchmark
The following summarizes the cross-platform geometric-mean performance across 4 tested hosts (Apple M2 Max, Intel Xeon Platinum 8269CY, AMD EPYC, ARM Neoverse-N1). See smhasher3 for the complete 16-library ranking and failure lists.
See the "Performance Benchmark Details" section at the end for per-platform tier breakdowns and charts.
Comparison libraries include gxhash (v4, gxhash4), lanehash (AES variant lh_aes and pure-arithmetic variant lanehash64), foldhash (foldhash_fast and foldhash_quality), rapidhash, xxhash-rust (xxh3), ahash, rustc-hash (fxhash), and the standard library std.
Cross-host geometric-mean throughput for slice scenarios (unit: GiB/s, higher is faster):
| Algorithm | Short slice 4..=128 B | Long slice 256 B..=256 KiB | Random short slice | Geometric mean |
|---|---|---|---|---|
| ihash | 7.44 | 45.99 | 4.96 | 19.84 |
| gxhash4 | 6.35 | 42.78 | 4.29 | 17.74 |
| foldhash_fast | 5.92 | 15.91 | 3.87 | 10.07 |
| lh_aes | 2.36 | 31.48 | 2.05 | 9.53 |
| lanehash64 | 3.08 | 23.33 | 2.29 | 9.17 |
| xxh3 | 4.23 | 15.29 | 2.53 | 8.45 |
| ahash | 4.14 | 8.39 | 3.15 | 6.06 |
HashMap multi-key-type cross-host geometric-mean throughput (10,000 keys, including 32..=59 B URLs, unit Mop/s, higher is faster):
| Hasher | u64 R/W | Short string R/W | URL R/W | Total geometric mean |
|---|---|---|---|---|
| ihash | 129.3 | 28.1 | 16.3 | 38.9 |
| foldhash_fast | 136.5 | 24.8 | 14.4 | 36.5 |
| fxhash | 138.6 | 23.8 | 14.6 | 36.4 |
| foldhash_quality | 116.2 | 23.8 | 14.5 | 34.2 |
| rapidhash | 115.8 | 22.4 | 13.4 | 32.6 |
| ahash | 117.5 | 21.7 | 13.4 | 32.5 |
| gxhash4 | 109.7 | 22.3 | 13.5 | 32.1 |
| std | 58.8 | 18.4 | 11.0 | 22.9 |
Quality and scenario notes:
fxhashandfoldhash_fastomit or simplify the full avalanche finalization to accelerate short-key R/W and do not pass theSMHasher3checks; see smhasher3 for complete failure details.- All 32 / 64 / 128 / 256-bit slice hashes of
ihashpass all 20SMHasher3test suites with zero failures (see Hash Quality).
Usage
Full example code: examples/basic.rs, run command:
use Hasher;
use cpu;
use ;
Build Configuration
It is recommended to enable hardware AES and base SIMD features in .cargo/config.toml at the project or workspace root:
[]
= ["-C", "target-feature=+aes,+sse2"]
[]
= ["-C", "target-feature=+aes,+neon"]
- Why enable it: Rust compiles only to the minimum common instruction baseline by default. Without
+aes, hardware AES instructions must be dispatched via runtime function pointers, and the compiler cannot inline them into theHashMapprobe loop or<= 128 Bshort-key call sites. Once enabled, the short path can be inlined across crate boundaries as native AES instructions; withstdenabled,x86_64still automatically upgrades toAVX + AES,AVX2 + VAES, orAVX-512F + VAESat runtime for> 128 Blarge blocks. - Hardware availability:
x86_64from Intel Westmere (2010), AMD Bulldozer (2011) and later, as well as mainstream server and desktop/mobileaarch64processors, all ship with native hardware AES. - No hardware AES: For older chips or embedded cores without crypto extensions, simply omit the corresponding
rustflagsto automatically fall back to the built-in scalar T-table;RISC-VandWebAssemblyare unaffected. To enable software SIMD acceleration, attach thecpufeature to callihash::cpu.
Interface
Root Module Seedless Default Interface
hash32(data: &[u8]) -> u32hash64(data: &[u8]) -> u64hash128(data: &[u8]) -> u128hash256(data: &[u8]) -> [u8; 32]hash_xof(data: &[u8], out: &mut [u8])Stream:Stream::new(data),Stream::from_root(root),root(),position(),seek(pos),fill(out),xor_keystream(buf); implementsstd::io::Readwhenstdis enabledIHasher:new(),finish_u128(), implementscore::hash::HasherIBuildHasher:new(),default()(per-thread random independent seed whenstdis enabled)HashMap<K, V>,HashSet<T>,HashMapExt,HashSetExt(available whenstdis enabled)
Explicit Seed Module
When a fixed u64 seed is needed, call the corresponding functions under ihash::seed:
seed::hash32(data, seed),seed::hash64(data, seed),seed::hash128(data, seed),seed::hash256(data, seed)seed::hash_xof(data, seed, out)seed::stream(data, seed),seed::keystream(seed)(derived fromhash256(&[], seed))seed::hasher(seed),seed::build_hasher(seed),seed::hash_map(seed),seed::hash_set(seed)(the latter two requirestd)
Pure Software Fallback and C Interface
ihash::cpu(requires featurecpu): mirrors all functions,Stream,IHasher, andIBuildHasherfrom the root module, pluscpu::HashMap/cpu::HashSet(requiresstd, paired with root-moduleHashMapExt/HashSetExt) and thecpu::seedsubmodule. It also provides construction entry points with a specifiedfearless_simd::Levelfor free functions,Stream, and hashers.ihash::c(requires featurec): exports C ABI symbols consistent with the headerinclude/ihash.h(including no-seed and*_seedentry points). Build a static library withcargo rustc -p ihash --release --features c --crate-type staticlib.
Feature Flags
std(enabled by default): EnablesHashMap/HashSet, runtime instruction-set dispatch,std::io::Read, and per-thread random hash-table seeds. When disabled, the crate operates in a#![no_std]environment andIBuildHasher::default()falls back to seed0(useseed::build_hasher(seed)instead).cpu: Enables theihash::cpupure-software AES + SIMD fallback implementation.c: Exports the stable C ABI symbols fromihash::c.
Extendable Output and Addressable Stream
Concepts and Prefix Relationships
Traditional hash functions return fixed-length integers only. If the application needs more pseudo-random bytes, it often has to add salt and recompute over multiple rounds. ihash extends output from a fixed width to an arbitrary byte length and provides a random-access streaming interface Stream:
- Strict prefix consistency:
hash32,hash64,hash128, andhash256are bit-identical to the first 4, 8, 16, and 32 bytes ofhash_xofandStreamoutput respectively; multi-width digests from the same input batch can be extracted at zero recomputation cost. - Parallel derivation and
O(1)seeking: afterhash256produces a 256-bit root node and derives 4 sets of round keys, data from byte 32 onward is generated in parallel by 4 rounds of simplified AES-CTR in 16-byte blocks; callingStream::seek(pos)jumps directly to any byte offset for reading or XOR without sequentially computing preceding bytes.
Typical Application Scenarios
- Derive multiple parameter sets from a single digest: compute
hash256once or readhash_xof, then slice out multiple position sets, weight tables, or test keys for a Bloom filter. - Sharded stream mixing and multi-threaded reads: each thread holds the same 256-bit root node,
seeks to its own offset, and executesxor_keystreamin parallel. - Deterministic stress testing and programmatic generation: fuzz-test corpus expansion or storage stress tests can stream GB-scale reproducible pseudo-random payloads directly through
Stream, eliminating the need for pre-allocated memory.
Stream is positioned as a high-speed, non-cryptographic stream-key mixer. Use a standard cryptographic suite if you need to resist cryptographic attacks.
Capability Comparison and Selection Reference
Beyond throughput, selection should also evaluate output bit-width, cross-platform consistency, memory-safety bounds, and struct size.
Output Bit Width and Streaming Extension
| Algorithm | Output bit width | Extended output | Random seek in output stream |
|---|---|---|---|
| ihash | 32 / 64 / 128 / 256 | Supported | Supported |
| gxhash | 32 / 64 / 128 | Unsupported | Unsupported |
| lanehash | 64 / 128 | Unsupported | Unsupported |
| xxh3 | 64 / 128 | Unsupported | Unsupported |
| foldhash | 64 | Unsupported | Unsupported |
| ahash | 64 | Unsupported | Unsupported |
| fxhash | 32 / 64 | Unsupported | Unsupported |
32 / 64-bit is suitable for in-memory hash tables and shard modulo; for persistent content addressing, file-block deduplication (CDC), or billion-scale object caches, use 128 / 256-bit. ihash trims high-half-region rounds via compile-time generics, so short-digest calls incur zero extra round overhead.
Cross-Platform Consistency and Runtime Environment
| Algorithm | Cross-platform consistent | Fallback without hardware AES | #![no_std] |
|---|---|---|---|
| ihash | Hardware / software / scalar | Supported | Supported |
| gxhash | Consistent across same-major-version hardware | Compilation fails | Supported |
| lanehash | Cross-platform consistent | Supported | Supported |
| xxh3 | Cross-platform consistent | Supported | Supported |
| foldhash | Not guaranteed | Supported | Supported |
| ahash | Not guaranteed | Supported | Supported |
| fxhash | Not guaranteed | Supported | Supported |
foldhash, ahash, and fxhash are positioned as single-process in-memory hash-table builders and do not guarantee cross-architecture digest equality; persistent index verification and cross-platform cache sharding require bit-identical digests across platforms.
Zero Out-of-Bounds Reads and Memory Safety Boundaries
| Algorithm | Zero out-of-bounds reads | Short input tail handling |
|---|---|---|
| ihash | Supported | Exact boundary loads |
| gxhash | Unsupported | Out-of-bounds read within page |
| lanehash | Supported | Segmented exact reads |
| xxh3 | Supported | Segmented exact reads |
| foldhash | Supported | Segmented exact reads |
| ahash | Supported | Segmented exact reads |
| fxhash | Supported | Segmented exact reads |
Some SIMD algorithms, when input is under 16 bytes, still perform whole-block out-of-bounds reads and then mask, which may trigger warnings from AddressSanitizer, Valgrind, Miri, or ARM MTE checks. ihash assembles precisely by actual bytes in 0..=16 B; in 17..=128 B it performs only head-and-tail overlap reads within slice boundaries, combined with multi-lane AES column mixing to eliminate overlap correlation, achieving zero out-of-bounds access at all lengths.
State Size and Hash Table Overhead
The following shows struct sizes for streaming hashers and table-seed state of each library on 64-bit targets (unit: bytes; ahash streaming state is 32 bytes under soft fallback, 48 bytes with x86_64 hardware AES; xxh3 with a custom seed/key raises the constructor and streaming state to 216 and 576 bytes respectively):
| Algorithm | Streaming state | Table seed state |
|---|---|---|
| ihash | 8 | 8 |
| gxhash | 16 | 16 |
| lanehash | 48 | 24 |
| xxh3 | 384 | 0 |
| foldhash | 48 | 8 |
| ahash | 32 | 32 |
| fxhash | 8 | 0 |
| std | 72 | 16 |
IBuildHasher occupies only 8 bytes, compressing metadata memory when maintaining a large number of small tables; IHasher converges streaming state into a single 8-byte general-purpose register, balancing short-key HashMap lookup speed with a per-thread random seed.
Hash Quality
Against the pure-Rust port of smhasher3, all 4 output bit-widths pass the full 20-suite quality battery with zero failures (covering Sanity, Avalanche, BIC, Sparse including 512-bit 22,370,049 sparse keys, Permutation, Cyclic, TwoBytes, PerlinNoise, Bitflip, Seed*, and BadSeeds):
| Algorithm | Bit width | Suites passed | Sub-items passed | Failures |
|---|---|---|---|---|
| ihash32 | 32 | 20 / 20 | 188 / 188 | 0 |
| ihash64 | 64 | 20 / 20 | 189 / 189 | 0 |
| ihash128 | 128 | 20 / 20 | 189 / 189 | 0 |
| ihash256 | 256 | 20 / 20 | 187 / 187 | 0 |
Design Principles
- Architecture fusion and asymmetric finalization: drawing on gxhash single-instruction AES round-function diffusion, lanehash multi-lane parallel stripes, and foldhash single-register
HashMapstate folding, ensuring every 16 bytes undergoes at least one round of round-key addition mixing; 4-lane finishing combines the final round's column-mixing-freeFL, 64-bit integer addition, and byte interleaving to break column linear elimination, with pre-operation feedforward eliminating truncation distinguishers. - Tiered absorption and hardware adaptation:
0..=16 Bmoves length encoding out of the serial critical path;17..=64 Buses 2 / 4-lane parallel absorption,65..=128 Beliminates sparse collisions by cross-adding head and tail to exploit MDS branch count;129..=192 Btakes a 3-stripe fast path,193 B..=2 KiBuses 4 / 8-lane parallel absorption,> 2 KiBuses 16-lane alternating stripes reading in ascending address order (dispatchesVAES256/VAES512on demand understd), with fused XOR ordering separately optimized forx86_64andaarch64AES instruction semantics. - Hash-flood protection and pure-software synergy: with
stdenabled,IBuildHasherderives an independent random seed for each hash table via a thread-local lock-free counter (verified by adversarial.rs adversarial checks); ihash::cpu contains no platform-conditional compilation branches, guaranteeing bit-identical results with the hardware path throughfearless_simdand register-resident S-box lookups.
Performance Benchmark Details
The following lists throughput line charts, short/long slice comparisons, HashMap throughput, multi-bit-width averages, and cross-platform consistency for each of the 4 measured hosts.
The complete 16-library ranking, all 13-tier breakdowns, and per-algorithm failure lists are documented in smhasher3.
Apple M2 Max
macOS, aarch64, 12 cores, compiled with +neon,+aes,+sha2 enabled; measured to support ARMv8 AES + NEON.
Short-slice throughput (4..=128 B, in GiB/s):
| Algorithm | 4 B | 8 B | 16 B | 32 B | 64 B | 128 B | Random short slice | Short-key avg |
|---|---|---|---|---|---|---|---|---|
| ihash | 3.43 | 6.93 | 15.80 | 25.38 | 35.27 | 49.71 | 13.72 | 15.99 |
| gxhash4 | 3.29 | 6.75 | 14.48 | 20.02 | 32.17 | 44.51 | 8.40 | 14.48 |
| lh_aes | 1.07 | 2.12 | 4.49 | 8.41 | 9.95 | 24.64 | 4.51 | 5.26 |
| lanehash64 | 1.77 | 3.34 | 7.13 | 12.09 | 16.67 | 14.56 | 5.15 | 7.06 |
| foldhash_fast | 4.02 | 9.53 | 20.27 | 13.92 | 22.45 | 31.37 | 8.21 | 14.03 |
| xxh3 | 2.48 | 4.81 | 9.50 | 12.47 | 15.25 | 16.83 | 5.25 | 8.45 |
| ahash | 2.92 | 5.95 | 11.77 | 16.30 | 19.05 | 20.97 | 7.16 | 10.49 |
Long-slice throughput (256 B..=256 KiB, in GiB/s):
| Algorithm | 256 B | 512 B | 1 KiB | 4 KiB | 16 KiB | 64 KiB | 256 KiB | Long-key avg | Full-length avg |
|---|---|---|---|---|---|---|---|---|---|
| ihash | 57.64 | 76.17 | 87.51 | 102.41 | 120.01 | 127.63 | 78.46 | 89.85 | 40.50 |
| gxhash4 | 63.52 | 77.72 | 91.41 | 107.46 | 122.35 | 124.06 | 79.09 | 92.56 | 39.32 |
| lh_aes | 39.23 | 39.06 | 55.41 | 71.64 | 82.51 | 87.27 | 79.61 | 61.91 | 19.83 |
| lanehash64 | 18.91 | 20.47 | 25.29 | 41.21 | 49.10 | 51.09 | 50.02 | 33.82 | 16.42 |
| foldhash_fast | 32.79 | 35.87 | 39.16 | 41.46 | 41.48 | 42.37 | 38.98 | 38.74 | 24.24 |
| xxh3 | 25.84 | 29.96 | 34.16 | 36.05 | 34.09 | 34.44 | 32.82 | 32.31 | 17.39 |
| ahash | 20.53 | 20.27 | 17.66 | 17.27 | 16.36 | 16.38 | 15.51 | 17.62 | 13.87 |
HashMap multi-key-type read/write throughput (in Mop/s):
| Hasher | u64 write | u64 read | Short string write | Short string read | URL write | URL read | Geometric mean |
|---|---|---|---|---|---|---|---|
| ihash | 248.7 | 468.8 | 56.1 | 153.9 | 44.1 | 114.4 | 131.1 |
| gxhash4 | 226.4 | 468.7 | 42.0 | 145.8 | 34.9 | 123.4 | 118.7 |
| foldhash_fast | 267.3 | 525.2 | 53.4 | 170.7 | 46.9 | 116.4 | 138.3 |
| foldhash_quality | 239.3 | 441.2 | 48.9 | 156.3 | 41.8 | 118.2 | 125.9 |
| rapidhash | 258.1 | 442.0 | 47.3 | 147.1 | 46.9 | 101.9 | 124.9 |
| ahash | 260.6 | 459.8 | 48.4 | 134.4 | 48.3 | 95.8 | 123.8 |
| fxhash | 261.2 | 606.1 | 50.5 | 158.3 | 42.6 | 115.9 | 135.7 |
| std | 118.0 | 145.2 | 53.0 | 81.5 | 29.8 | 47.2 | 68.6 |
Multi-width, extended output, and pure-software fallback geometric means (in GiB/s):
| hash32 | hash64 | hash128 | hash256 | hash_xof | Stream | cpu fallback | lanehash64 |
|---|---|---|---|---|---|---|---|
| 67.45 | 65.92 | 65.76 | 66.99 | 20.11 | 21.93 | 2.84 | 15.27 |
Intel Xeon Platinum 8269CY
Linux, x86_64, 4 cores, compiled with +sse2,+aes enabled; measured to support AVX-512F + AVX2 + AES-NI.
Short-slice throughput (4..=128 B, in GiB/s):
| Algorithm | 4 B | 8 B | 16 B | 32 B | 64 B | 128 B | Random short slice | Short-key avg |
|---|---|---|---|---|---|---|---|---|
| ihash | 1.23 | 2.65 | 5.57 | 8.59 | 13.24 | 19.14 | 3.58 | 5.83 |
| gxhash4 | 1.16 | 2.23 | 5.15 | 7.97 | 12.80 | 14.82 | 3.40 | 5.22 |
| lh_aes | 0.43 | 0.85 | 1.65 | 3.19 | 4.39 | 11.30 | 1.79 | 2.14 |
| lanehash64 | 0.59 | 1.18 | 2.13 | 4.79 | 6.53 | 6.24 | 1.84 | 2.57 |
| foldhash_fast | 1.53 | 3.53 | 6.35 | 4.82 | 7.32 | 12.00 | 3.52 | 4.94 |
| xxh3 | 0.86 | 1.64 | 3.33 | 6.02 | 8.36 | 10.20 | 2.33 | 3.66 |
| ahash | 0.75 | 2.19 | 3.75 | 7.63 | 6.95 | 5.04 | 2.42 | 3.44 |
Long-slice throughput (256 B..=256 KiB, in GiB/s):
| Algorithm | 256 B | 512 B | 1 KiB | 4 KiB | 16 KiB | 64 KiB | 256 KiB | Long-key avg | Full-length avg |
|---|---|---|---|---|---|---|---|---|---|
| ihash | 20.55 | 30.25 | 32.54 | 34.82 | 36.65 | 37.74 | 39.44 | 32.52 | 14.71 |
| gxhash4 | 21.56 | 29.55 | 30.38 | 33.83 | 34.89 | 34.97 | 39.07 | 31.57 | 13.76 |
| lh_aes | 15.31 | 18.07 | 24.88 | 30.49 | 33.19 | 36.40 | 38.52 | 26.74 | 8.33 |
| lanehash64 | 8.37 | 17.08 | 29.20 | 54.25 | 57.55 | 56.68 | 59.72 | 33.16 | 10.19 |
| foldhash_fast | 11.78 | 14.04 | 17.62 | 19.16 | 16.80 | 16.86 | 17.29 | 16.04 | 9.31 |
| xxh3 | 9.27 | 11.64 | 13.76 | 14.38 | 13.07 | 14.07 | 13.92 | 12.74 | 7.17 |
| ahash | 5.99 | 6.55 | 6.88 | 7.04 | 6.81 | 6.89 | 7.25 | 6.76 | 4.95 |
HashMap multi-key-type read/write throughput (in Mop/s):
| Hasher | u64 write | u64 read | Short string write | Short string read | URL write | URL read | Geometric mean |
|---|---|---|---|---|---|---|---|
| ihash | 51.0 | 172.7 | 14.1 | 35.0 | 12.3 | 11.2 | 29.0 |
| gxhash4 | 43.4 | 126.2 | 12.6 | 31.5 | 10.4 | 9.6 | 24.6 |
| foldhash_fast | 51.1 | 174.3 | 13.9 | 34.2 | 12.5 | 11.4 | 29.0 |
| foldhash_quality | 48.5 | 149.1 | 13.5 | 31.7 | 11.7 | 10.8 | 27.0 |
| rapidhash | 48.8 | 149.3 | 13.4 | 31.1 | 11.1 | 10.5 | 26.6 |
| ahash | 48.5 | 149.3 | 13.2 | 30.3 | 10.4 | 9.7 | 25.8 |
| fxhash | 53.3 | 193.2 | 14.0 | 32.9 | 12.1 | 10.9 | 29.3 |
| std | 33.2 | 59.6 | 12.0 | 21.2 | 9.9 | 10.1 | 19.2 |
Multi-width, extended output, and pure-software fallback geometric means (in GiB/s):
| hash32 | hash64 | hash128 | hash256 | hash_xof | Stream | cpu fallback | lanehash64 |
|---|---|---|---|---|---|---|---|
| 24.29 | 25.02 | 25.18 | 23.20 | 6.69 | 9.21 | 1.38 | 10.67 |
AMD EPYC
Linux, x86_64, 8 cores, compiled with +sse2,+aes enabled; measured to support AVX2 + AES-NI.
Short-slice throughput (4..=128 B, in GiB/s):
| Algorithm | 4 B | 8 B | 16 B | 32 B | 64 B | 128 B | Random short slice | Short-key avg |
|---|---|---|---|---|---|---|---|---|
| ihash | 0.78 | 2.90 | 4.80 | 7.65 | 12.20 | 18.92 | 3.67 | 5.17 |
| gxhash4 | 0.78 | 0.77 | 4.53 | 5.86 | 7.63 | 15.36 | 3.70 | 3.51 |
| lh_aes | 0.30 | 0.59 | 1.59 | 2.80 | 2.62 | 9.65 | 1.42 | 1.64 |
| lanehash64 | 0.44 | 1.03 | 2.33 | 3.34 | 2.83 | 6.24 | 1.62 | 1.99 |
| foldhash_fast | 0.94 | 4.06 | 7.86 | 3.94 | 7.72 | 13.06 | 2.78 | 4.78 |
| xxh3 | 0.83 | 0.91 | 3.89 | 5.69 | 8.32 | 10.28 | 1.67 | 3.35 |
| ahash | 1.09 | 1.30 | 3.89 | 8.16 | 7.08 | 5.07 | 2.37 | 3.43 |
Long-slice throughput (256 B..=256 KiB, in GiB/s):
| Algorithm | 256 B | 512 B | 1 KiB | 4 KiB | 16 KiB | 64 KiB | 256 KiB | Long-key avg | Full-length avg |
|---|---|---|---|---|---|---|---|---|---|
| ihash | 24.84 | 30.82 | 46.93 | 42.27 | 61.13 | 62.40 | 45.97 | 42.88 | 16.15 |
| gxhash4 | 22.31 | 28.79 | 37.85 | 29.38 | 38.41 | 36.62 | 38.80 | 32.58 | 11.66 |
| lh_aes | 14.95 | 18.02 | 27.32 | 28.43 | 33.05 | 28.71 | 36.87 | 25.66 | 7.22 |
| lanehash64 | 9.47 | 7.78 | 17.63 | 30.58 | 40.08 | 42.60 | 39.58 | 22.23 | 7.30 |
| foldhash_fast | 14.41 | 13.11 | 17.67 | 17.43 | 20.22 | 18.02 | 17.94 | 16.82 | 9.41 |
| xxh3 | 7.44 | 9.41 | 7.83 | 11.68 | 12.99 | 11.72 | 13.76 | 10.43 | 6.18 |
| ahash | 6.49 | 6.36 | 6.24 | 7.10 | 7.33 | 7.47 | 7.61 | 6.92 | 5.00 |
HashMap multi-key-type read/write throughput (in Mop/s):
| Hasher | u64 Write | u64 Lookup | Short String Write | Short String Lookup | URL Write | URL Lookup | Geometric Mean |
|---|---|---|---|---|---|---|---|
| ihash | 60.7 | 140.6 | 18.0 | 30.3 | 14.5 | 11.9 | 30.5 |
| gxhash4 | 51.5 | 117.8 | 15.1 | 23.2 | 11.5 | 11.2 | 25.5 |
| foldhash_fast | 66.7 | 169.3 | 17.3 | 29.7 | 12.1 | 10.4 | 30.0 |
| foldhash_quality | 58.5 | 130.7 | 15.6 | 26.7 | 12.4 | 11.1 | 27.5 |
| rapidhash | 56.1 | 120.1 | 14.4 | 24.3 | 10.1 | 10.0 | 24.9 |
| ahash | 58.0 | 126.4 | 14.2 | 23.0 | 10.3 | 9.9 | 25.0 |
| fxhash | 54.5 | 151.0 | 15.1 | 26.6 | 11.8 | 11.0 | 27.5 |
| std | 30.8 | 49.6 | 12.8 | 18.1 | 9.9 | 8.7 | 17.7 |
Multi-width, extended output, and pure-software fallback geometric means (in GiB/s):
| hash32 | hash64 | hash128 | hash256 | hash_xof | Stream | cpu fallback | lanehash64 |
|---|---|---|---|---|---|---|---|
| 28.55 | 29.39 | 28.94 | 27.67 | 6.95 | 8.42 | 1.33 | 8.08 |
ARM Neoverse-N1
Linux, aarch64, 6 cores, compiled with +neon,+aes, verified support for ARMv8 AES + NEON.
Short-slice throughput (4..=128 B, in GiB/s):
| Algorithm | 4 B | 8 B | 16 B | 32 B | 64 B | 128 B | Random Short Slice | Short Key Average |
|---|---|---|---|---|---|---|---|---|
| ihash | 1.26 | 2.99 | 6.96 | 11.04 | 13.87 | 16.64 | 3.37 | 6.37 |
| gxhash4 | 1.50 | 2.97 | 6.80 | 10.19 | 11.77 | 14.41 | 3.21 | 6.11 |
| lh_aes | 0.37 | 0.77 | 1.56 | 1.78 | 3.28 | 9.04 | 1.55 | 1.69 |
| lanehash64 | 0.68 | 1.34 | 2.71 | 4.19 | 5.02 | 4.67 | 1.78 | 2.49 |
| foldhash_fast | 1.58 | 3.11 | 6.31 | 3.14 | 4.20 | 6.30 | 2.78 | 3.70 |
| xxh3 | 0.99 | 1.98 | 3.48 | 4.39 | 5.17 | 5.70 | 2.00 | 3.10 |
| ahash | 0.63 | 1.30 | 2.59 | 3.67 | 4.65 | 5.06 | 2.40 | 2.38 |
Long-slice throughput (256 B..=256 KiB, in GiB/s):
| Algorithm | 256 B | 512 B | 1 KiB | 4 KiB | 16 KiB | 64 KiB | 256 KiB | Long Key Average | Full-Range Average |
|---|---|---|---|---|---|---|---|---|---|
| ihash | 23.81 | 31.05 | 33.73 | 39.88 | 42.85 | 42.07 | 41.22 | 35.70 | 16.11 |
| gxhash4 | 23.31 | 30.00 | 33.25 | 38.92 | 42.58 | 42.45 | 40.86 | 35.19 | 15.69 |
| lh_aes | 13.36 | 14.88 | 21.50 | 26.90 | 31.11 | 31.54 | 31.27 | 23.12 | 6.91 |
| lanehash64 | 5.83 | 6.78 | 8.61 | 15.42 | 19.20 | 19.98 | 16.67 | 11.89 | 5.78 |
| foldhash_fast | 6.26 | 5.92 | 6.30 | 6.30 | 6.30 | 6.28 | 5.56 | 6.13 | 4.85 |
| xxh3 | 9.15 | 11.51 | 13.49 | 14.25 | 14.59 | 14.74 | 12.47 | 12.73 | 6.63 |
| ahash | 5.74 | 6.03 | 6.17 | 6.22 | 6.21 | 6.23 | 5.54 | 6.02 | 3.92 |
HashMap multi-key-type read/write throughput (in Mop/s):
| Hasher | u64 Write | u64 Lookup | Short String Write | Short String Lookup | URL Write | URL Lookup | Geometric Mean |
|---|---|---|---|---|---|---|---|
| ihash | 50.5 | 176.1 | 9.2 | 18.3 | 5.3 | 7.7 | 19.8 |
| gxhash4 | 43.7 | 136.2 | 7.2 | 10.0 | 4.8 | 4.1 | 14.3 |
| foldhash_fast | 50.5 | 169.5 | 6.6 | 9.8 | 4.7 | 4.0 | 14.8 |
| foldhash_quality | 42.9 | 133.0 | 7.7 | 9.9 | 5.3 | 4.4 | 14.7 |
| rapidhash | 43.4 | 133.5 | 6.9 | 9.0 | 4.9 | 3.7 | 13.7 |
| ahash | 43.5 | 130.9 | 6.4 | 9.2 | 5.3 | 4.2 | 14.0 |
| fxhash | 53.2 | 191.3 | 7.1 | 9.9 | 5.6 | 4.4 | 16.1 |
| std | 38.5 | 71.6 | 6.4 | 8.2 | 4.5 | 3.8 | 11.7 |
Multi-width, extended output, and pure-software fallback geometric means (in GiB/s):
| hash32 | hash64 | hash128 | hash256 | hash_xof | Stream | cpu fallback | lanehash64 |
|---|---|---|---|---|---|---|---|
| 26.74 | 26.86 | 26.27 | 25.55 | 6.02 | 7.32 | 1.29 | 5.71 |
Cross-platform consistency
Before timing begins, each host runs a self-check over every byte length from 0..=1100 B as well as 4 KiB, 16 KiB, and 64 KiB (1,104 length tiers × 3 seed groups = 3,312 input sets in total).
The local hardware-accelerated path has been verified bit-for-bit against the ihash::cpu pure-software path, and all outputs across hash32, hash64, hash128, hash256, hash_xof, and Stream are identical on 4 hosts with different architectures.