New high-quality hash measures 71GB/s on M4

102 points40 comments3 days ago
eqvinox

Why are the numbers in the "performance" section almost all for AArch64? Where are the AMD64 numbers?

jandrewrogers

Without getting too deep in the technical weeds, I will assert that rapidhash is an excellent small-key hash function and approximately the state-of-the-art for that purpose. There is nothing else better that I am aware of in this scope.

For bulk hashing there are better functions, but XXH3, GXHash, etc are not among them, being both slower and weaker than the state-of-the-art. Hash functions that can’t pass quality tests are not serious contenders.

show comments
aidenn0

At some point, hashes are fast enough. I'm not going to be switching from xxhash to shave 40 picoseconds off of hashing small keys, and for large keys it's already a few orders of magnitude faster than my NVMe drive.

show comments
rurban

It's not the fastest on smhasher anymore. umash is better and faster, and gxhash is twice as fast. It's is however very hashmap friendly because of its small size. It's a wyhash variant

show comments
curiouscoding

I'd love to see some benchmarks/comparison on variable length strings. For strings with random length between 10 and 30, gxhash was significantly faster than xxhash for me. I would assume because it processes chunks of up to 32 chars at a time, avoiding branch misses.

Generally my feeling is that at these speeds, designing for branch-predictability for short strings might be more important than absolute throughput.

realo

At a few ns per hash, it means the hash is done before photons from your screen reach your eyes.

Impressive!

show comments
wpollock

Is rapidhash cache-friendly?

show comments
bandrami

I saw the first four words and then was disappointed by the direction it took...

show comments