Skip to content

Switch sha1 to siphash #3047

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

Closed
wants to merge 2 commits into from
Closed

Switch sha1 to siphash #3047

wants to merge 2 commits into from

Conversation

dgryski
Copy link
Contributor

@dgryski dgryski commented Jul 28, 2012

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.

dgryski added 2 commits July 28, 2012 23:37
    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.
@dgryski
Copy link
Contributor Author

dgryski commented Jul 29, 2012

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... :|

@graydon
Copy link
Contributor

graydon commented Jul 30, 2012

Rebased and landed in 1854a73

@graydon graydon closed this Jul 30, 2012
@graydon
Copy link
Contributor

graydon commented Jul 30, 2012

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 <[email protected]>
Co-authored-by: Zyad Hassan <[email protected]>
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.

2 participants