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 unstable 128 bit SipHash version for internal use in the compiler. #45237

Closed

Conversation

michaelwoerister
Copy link
Member

Discussion in #41215 seems to show that a 128 bit SipHash is the best compromise between hash quality and performance. This PR adds an unstable, hidden 128 bit variant to the SipHash implementation in libstd for use solely within the compiler. A future PR would then switch StableHasher to use this implementation.

What do you say, @rust-lang/libs? Acceptable?

r? @alexcrichton

@sfackler
Copy link
Member

Since it's not something we'd want to stabilize, I think I'd mildly prefer for it to live in a rustc-internal crate if possible.

@michaelwoerister
Copy link
Member Author

Since it's not something we'd want to stabilize, I think I'd mildly prefer for it to live in a rustc-internal crate if possible.

The problem with that is that the implementations of the 64 bit version and the 128 bit version are 95% the same. It's just an additional finish method and slightly adapted initialization that are needed for the 128 bit version.

@alexcrichton
Copy link
Member

I'd personally lean the same way as @sfackler in that we probably want to vendor this in rustc internals for now. The duplication is indeed unfortunate, but hopefully not too bad as it's roughly just one module I think, right?

@michaelwoerister
Copy link
Member Author

OK, I'll do that then. 👍

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.

3 participants