Closed Urgau closed 2 months ago
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 rustc
fork with the integration of this crate, Urgau:rustc-stable-hash.
I have opened https://github.com/rust-lang/rust/pull/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.
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