Switch sha1 to siphash#3047
Closed
dgryski wants to merge 2 commits intorust-lang:incomingfrom
dgryski:switch-sha1-to-siphash-859
Closed
Switch sha1 to siphash#3047dgryski wants to merge 2 commits intorust-lang:incomingfrom dgryski:switch-sha1-to-siphash-859
dgryski wants to merge 2 commits intorust-lang:incomingfrom
dgryski:switch-sha1-to-siphash-859
Conversation
Updating types std::sha1::sha1 -> hash::streaming was a relatively
small change. Renaming the variables to reflect that things aren't
sha1s any more touched far more lines.
Contributor
Author
|
Just for fun, I figured out what the improvement to the build time this gives. I modified the existing sha1 code to log every single request, and then replayed those logs against the sha1 code and the new siphash code. Across the entire stage1..3 builds, there are 29260 requests for hash codes build from 146305 partial strings. The existing sha1 code takes 325ms to process. The new improved siphash codes takes only 95ms. So, this patch shaves off 225ms from the 15 minute build time on my machine. I guess that's an improvement... :| |
Contributor
|
Rebased and landed in 1854a73 |
Contributor
|
thanks! |
RalfJung
pushed a commit
to RalfJung/rust
that referenced
this pull request
Sep 3, 2023
update target support section The MIPS targets were demoted to tier 3, so let's recommend a different big-endian target. Also instead of listing the targets we test individually, just say we test all tier 1 targets. r? `@rust-lang/miri`
celinval
pushed a commit
to celinval/rust-dev
that referenced
this pull request
Jun 4, 2024
Fetch functions of `atomic_ptr` calls atomic intrinsic functions with pointer-type arguments (`invalid_mut`), which will cause typecheck failures. The change in this commit add support of pointer-type arguments into `codegen_atomic_binop` to fix the issue. The new `codegen_atomic_binop` will cast pointer arguments to `size_t`, apply op on them, and then cast the op result back to the pointer type. The new test include all fetch functions of `atomic_ptr` except for `fetch_ptr_add` and `fetch_ptr_sub`, which do not call intrinsic functions. Resolves rust-lang#3042. --------- Co-authored-by: Adrian Palacios <73246657+adpaco-aws@users.noreply.github.com> Co-authored-by: Zyad Hassan <88045115+zhassan-aws@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This patch updates the use of sha1 in the compiler to use the new faster siphash implementation. It only seems to be used for the hashing types.
I created a hash::streaming interface that matched the existing sha1 interface and added a siphash implementation. Then, the one use of std::sha1::sha1 in the tree was replaced to use hash::streaming instead, and I renamed a bunch of variables that all assumed they were working with sha1s.
This should fix #859.