New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
xxHash instead of FNV?! #246
Comments
One particular requirement of hashable/src/Data/Hashable/Class.hs Lines 710 to 717 in b8a718c
hashable/src/Data/Hashable/Class.hs Lines 730 to 736 in b8a718c
I wonder whether this property can be upheld when xxHash is used. |
This is not a problem, xxHash supports stream hashing. I did a quick experiment using https://hackage.haskell.org/package/xxhash-ffi and numbers are almost too good to be true:
@phadej would you be open to using xxHash instead of FNV for |
@Bodigrim it's an option to use The former is easily doable; the latter isn't without breaking stuff. |
Probably GHC WASM/JS people will complain, I don't really care about these backends (my POV is that they don't exist yet), so i won't. EDIT: they don't complain about current cbits, adding more (or actually, replacing) shouldn't be a huge issue. |
I'm looking just for faster hashing of WASM should be fine, it can cope well with bundled C libraries. @phadej would you like me to take a stab at this? |
No need. I'd end up redoing it anyway. |
That's exactly why I asked ;) FWIW I gained maintainership for |
With regards to WASM, I got it working fine at https://github.com/haskell-haskey/xxhash-ffi, so this should not be an issue. Here are benchmarks after switching to XXH3:
|
I've released |
@Mistuke mentioned this algorithm in #118 (comment).
According to https://github.com/rurban/smhasher and https://github.com/Cyan4973/xxHash it compares nicely to FNV.
AFAIK GHC already uses this algorithm in its linker.
Has there already been any research towards using it in
hashable
?The text was updated successfully, but these errors were encountered: