Speed up pure-Go implementation by ensuring we use ROLQ instructions The compiler requires a little massaging to emit rotate instructions. This ends up being a fairly significant performance boost. name old time/op new time/op delta Hashes/xxhash,n=4KB-4 616ns ± 2% 466ns ± 1% -24.33% (p=0.008 n=5+5) name old speed new speed delta Hashes/xxhash,n=4KB-4 6.49GB/s ± 2% 8.57GB/s ± 1% +32.04% (p=0.008 n=5+5)
xxhash is a Go implementation of the 64-bit xxHash algorithm, XXH64. This is a high-quality hashing algorithm that is much faster than anything in the Go standard library.
On amd64 there is an even faster assembly implementation that runs at over 10 GB/s on my laptop.