1
Fork 0

Auto merge of #77476 - tgnottingham:buffered_siphasher128, r=nnethercote

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.
This commit is contained in:
bors 2020-10-25 09:23:45 +00:00
commit 5171cc76c2
3 changed files with 385 additions and 192 deletions

View file

@ -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]