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

Use ahash instead of SipHash #220

Merged
merged 3 commits into from
Jul 14, 2022
Merged

Use ahash instead of SipHash #220

merged 3 commits into from
Jul 14, 2022

Conversation

torkleyy
Copy link
Member

Partially reverts 4965640 (we use ahash again, but without using hashbrown which is just a copy of std::collections::HashMap with ahash as the default).

@torkleyy
Copy link
Member Author

cc @xMAC94x

This gets us back to the speed before I removed hashbrown in the last PR, but without the unnecessary dependency on hashbrown.

@xMAC94x
Copy link
Contributor

xMAC94x commented Jul 13, 2022

Any reason to choose ahash over fxhash? https://nnethercote.github.io/perf-book/hashing.html

I am not familar with the wide range, but let the veloren community know. there are quite some good experts in there that prob know the best hash for a crate like shred :)

@torkleyy
Copy link
Member Author

I figured the 1-4% improvement wouldn't be worth an implementation that's not as widely applicable and apparently it has some other pitfalls.

@xMAC94x
Copy link
Contributor

xMAC94x commented Jul 13, 2022

mhhh okay, do we have any benchmarks or how did we compare the performance regarding to hasbrown ?

@torkleyy
Copy link
Member Author

The benchmarks are linked in your comment:

An attempt to switch from fxhash to ahash resulted in slowdowns of 1-4%.

I think benchmarks in shred for this would be great as well, but for now, I just want to revert the accidental performance regression. Once we have such benchmarks we can also consider other hashers if they show beneficial.

@torkleyy torkleyy merged commit c38c3cb into master Jul 14, 2022
@torkleyy torkleyy deleted the ahash branch July 14, 2022 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants