Closed yyy33 closed 6 months ago
Generally Rust's hash interface is not very good for performance of xxhash due to it re-creating state every time. But on large input (i.e. 1kb) it would generally out perform fxhash.
If you're only concerned with usage within hash map I believe default hasher would suit you more than enough as most of the time your input will be fairly small keys.
But if you need high performance outside hash map I recommend to not use default hasher for sure. Especially if you need handle fairly large inputs (e.g. file, other binary blobs)
Other notes to consider:
Do note that if you need uniquness prefer hashes that has at least 128 bytes output like xxh3
btw I believe default hasher is SipHasher13 for HashMap
The rust compiler has an fxhash, which seems to be unencrypted as well, how does the speed of xxhash compare to its