Rapidhash: A new fastest rust hasher

3 liam-gray 1 8/4/2025, 11:23:02 AM github.com ↗

Comments (1)

liam-gray · 6h ago
I know it's a meme at this point, every six months someone comes along with a new fastest hasher, and this is yet another (sorry!).

Rapidhash is a non-cryptographic, general purpose hash function that:

- Passes SMHasher3's full hash quality benchmark suite

- Provides minimal DoS resistance in the same manner as foldhash and ahash

- Has stable/portable hashing and streaming variants

- Is incredibly fast without requiring any hardware acceleration on both x86 and ARM

I've heavily optimised the rapidhash rust crate's RapidHasher to make it competitive with other non-cryptographic hash functions on common use cases. Other hashers may still outperform for specific workloads (gxhash is blazing fast for hashing long strings on targets with AES instructions for example), but rapidhash performs incredibly well across the foldhash benchmark suite on all platforms without any special compiler flags.

This upgrade seems to make rapidhash a go-to general-purpose hash function when a cryptographic function isn't required.

Benchmarks have been provided for various platforms. All feedback and critique welcome!

Edit: list formatting