-
Notifications
You must be signed in to change notification settings - Fork 27
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
Hybrid state gxhash #34
Comments
s128 s256 hybird and the other hash maybe can draw it in the same picture so it looks clearer |
I can't because they're all generated from different compilation targets but I have used a max y of 130000 for all so scalewise it is comparable. |
Share an article for reference only https://deepmind.google/discover/blog/alphadev-discovers-faster-sorting-algorithms/ We applied AlphaDev to one of the most commonly used algorithms for hashing in data structures to try and discover a faster algorithm. And when we applied it to the 9-16 bytes range of the hashing function, the algorithm that AlphaDev discovered was 30% faster. This year, AlphaDev’s new hashing algorithm was released into the open-source Abseil library, available to millions of developers around the world, and we estimate that it’s now being used trillions of times a day. |
Interesting article but I doubt AI (at least AI as we know it currently) would help making gxhash more performant |
Are all these hashes stable ? |
Yes all hashes generated in v3 will be the same, independently from actual intrinsics used. |
Currently, the rust standard library uses hashbrown, and hashbrown uses ahash. I think you can try submitting a pull request to hashbrown first and replace ahash with gxhash. https://github.com/rust-lang/hashbrown Since Rust 1.36, this is now the HashMap implementation for the Rust standard library. However you may still want to use this crate instead since it works in environments without std, such as embedded systems and kernels. Uses AHash as the default hasher, which is much faster than SipHash. However, AHash does not provide the same level of HashDoS resistance as SipHash, so if that is important to you, you might want to consider using a different hasher. |
Yes I know I've already done that, and it was earlier today to be precise ;) This has led to this first issue #40 |
Context
Currently, gxhash with a 128-bit state is much faster for small input sizes, while gxhash with a 256-bit state is faster for large input sizes. The idea is to study the possibilities of making an hybrid state version of gxhash, leveraring the advantages of 128-bit state with the advantages of the 256-bit state processing, for maximum throughput for all input sizes.
See the break-even point:
Challenges
There are two ways to achieve this:
Some challenges are:
Todo
The text was updated successfully, but these errors were encountered: