Skip to content
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

Add PolymurHash #267

Closed
orlp opened this issue Jun 20, 2023 · 3 comments
Closed

Add PolymurHash #267

orlp opened this issue Jun 20, 2023 · 3 comments
Assignees

Comments

@orlp
Copy link

orlp commented Jun 20, 2023

Hi, I just released PolymurHash (https://github.com/orlp/polymur-hash) and I'd love it if it was included in your benchmark.

Inclusion should be really easy, it's a header-only C library without any dependencies/configuration. Only caveat is that it should be initialized with a seed separately in Hash_init, with the tweak parameter used for what SMHasher calls seed in the actual hash function.

I can make a pull request if you prefer.

@rurban rurban self-assigned this Jun 21, 2023
@rurban
Copy link
Owner

rurban commented Jun 21, 2023

Please check the polymur branch

rurban added a commit that referenced this issue Jun 21, 2023
rurban added a commit that referenced this issue Jun 21, 2023
@orlp
Copy link
Author

orlp commented Jun 21, 2023

That was quick! Looks good, just one nitpick on the code. Instead of 0xfedbca9876543210 | seed I'd suggest 0xfedbca9876543210 ^ seed in polymur_seed_init just to make sure no bits of the seed get lost.

Also note that, depending on the seed, there is a ~7% chance PolymurHash can fail the Sparse 16-bit key test. But I believe this to be a flaw in the test as even a perfect random oracle does this, see #114 (comment) . So perhaps you may want to re-open that issue.

And perhaps PolymurHash could get added to your list of "fastest hash functions on x86_64 without quality problems", because I do think its speed qualifies it as it's faster than some of those on the list, and Polymur gives much better guarantees than all of those on the list.

rurban added a commit that referenced this issue Jun 21, 2023
@rurban
Copy link
Owner

rurban commented Jun 21, 2023

added

@rurban rurban closed this as completed Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants