-
Notifications
You must be signed in to change notification settings - Fork 3
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
Introduce multi hasher support #8
Conversation
Thanks, @Urgau! Before we merge this I think we should make rustc actually use this crate instead of the one in rustc_data_structures. What do you think? It's making me a bit uneasy to keep making changes here without the feedback of them being integrated in the compiler, with respect to performance and also API design. |
I'm maintaining a branch on my I have opened rust-lang/rust#127479 so we can test the perf with those changes included, as well as seeing exactly the changes required to the compiler, which are minimal (nothing major). I think if the perf are acceptable we should merge this PR, make a release and merge the rustc PR to make use of the crate. |
@michaelwoerister perf are neutral on the rustc side. I think we can merge this PR and prepare the release. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some final comments. Looks great overall!
Thanks people for making this happen! |
This PR introduce multi
Hasher
support in ourStableHasher
by adding a new traitExtendedHasher
that extended the hasher trait with support for short writes and custom hash type and hook it up withStableHasher
.For brevity here is the API for
ExtendedHasher
:Unresolved questions:
SipHasher128
? or just exposingStableSipHasher128
is enough?hashers
moduleStableHasher::new
exist and callDefault::default
? or should it take a hasher as input?StableHasher::with_hasher
to handle this.r? @michaelwoerister
Fixes #5