AxHash
AxHash is a high-performance deterministic hashing family for Rust and native systems languages.
If you only need AxHash in Rust, start with the axhash crate from this workspace. It is the simplest entrypoint and re-exports the core engine with a friendlier import path.
AxHash is optimized for real-world HashMap workloads, concurrent systems, cache-heavy applications, and high-throughput native runtimes.
Ecosystem
| Crate | Description |
|---|---|
axhash |
High-performance hashing engine |
axhash-map |
Fast HashMap/HashSet powered by hashbrown |
axhash-indexmap |
Ordered maps with AxHash |
axhash-dashmap |
Concurrent DashMap powered by AxHash |
Features
- Deterministic hashing
- Seeded hashing support
- Streaming API
- Fast
HashMapintegration no_stdsupport- Cross-language FFI
- Concurrent-friendly design
Performance Highlights
Benchmarked with Criterion.rs on Apple Silicon (release mode).
| Benchmark | AxHash Performance |
|---|---|
HashMap get-hit (100k keys) |
~494 Melem/s |
HashMap get-miss (10k keys) |
~785 Melem/s |
HashMap insert-u64 (100k keys) |
~90 Melem/s |
u64 hashing throughput |
~2.0 Gelem/s |
| Thread-local concurrent hashing (8 threads) | ~750 Melem/s |
| Large-buffer throughput (64K) | ~94 GiB/s |
| Large-buffer throughput (4K) | ~100 GiB/s |
write_u64 latency |
~3 ns |
write_u128 latency |
~1.48 ns |
| Mixed struct hashing | ~290 Melem/s |
HashMap builder creation |
~1.3 ns |
Real-world HashMap Comparison
| Workload | AxHash | DefaultHasher |
|---|---|---|
insert-u64 (100k) |
~90 Melem/s | ~44 Melem/s |
get-hit (100k) |
~494 Melem/s | ~183 Melem/s |
get-miss (10k) |
~785 Melem/s | ~280 Melem/s |
| Mixed workload | ~11.9 Melem/s | ~6.1 Melem/s |
Concurrent Scaling
| Threads | Throughput |
|---|---|
| 1 | ~230 Melem/s |
| 2 | ~420 Melem/s |
| 4 | ~691 Melem/s |
| 8 | ~752 Melem/s |
See full Criterion benchmark reports for detailed graphs and methodology.
Pick The Right Package
- Rust:
axhash - C / C++ / Go / Zig / Swift / Kotlin Native:
axhash-ffi - Low-level engine /
no_std:axhash-core
Rust Quick Start
Add the simplest Rust package:
[]
= "0.8"
Hash raw bytes:
use hash;
Hash raw bytes with a seed:
use hash_with_seed;
Hash any Rust value that implements Hash:
use hash_value;
Use the streaming hasher:
use AxHasher;
use Hasher as _;
Use AxHash with HashMap:
use AxBuildHasher;
use HashMap;
Inspect the active backend:
use ;
Workspace Layout
- axhash-core: low-level Rust core and
no_stdengine - axhash-ffi: stable C ABI
License
MIT