Skip to content

Commit

Permalink
Auto merge of #77476 - tgnottingham:buffered_siphasher128, r=nnethercote
Browse files Browse the repository at this point in the history
perf: buffer SipHasher128

This is an attempt to improve Siphasher128 performance by buffering input. Although it reduces instruction count, I'm not confident the effect on wall times, or lack-thereof, is worth the change.

---

Additional notes not reflected in source comments:

* Implementation choices were guided by a combination of results from rustc-perf and micro-benchmarks, mostly the former.
* ~~I tried a couple of different struct layouts that might be more cache friendly with no obvious effect.~~ Update: a particular struct layout was chosen, but it's not critical to performance. See comments in source and discussion below.
* I suspect that buffering would be important to a SIMD-accelerated algorithm, but from what I've read and my own tests, SipHash does not seem very amenable to SIMD acceleration, at least by SSE.
  • Loading branch information
bors committed Oct 25, 2020
2 parents 3e0dd24 + a602d15 commit 5171cc7
Show file tree
Hide file tree
Showing 3 changed files with 389 additions and 196 deletions.
1 change: 1 addition & 0 deletions compiler/rustc_data_structures/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#![feature(const_panic)]
#![feature(min_const_generics)]
#![feature(once_cell)]
#![feature(maybe_uninit_uninit_array)]
#![allow(rustc::default_hash_types)]

#[macro_use]
Expand Down
Loading

0 comments on commit 5171cc7

Please sign in to comment.