diff options
| author | Daniel Csillag <dccsillag@gmail.com> | 2023-04-19 08:16:03 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-19 13:16:03 +0200 |
| commit | d0afba959d18d1c2c646b99e6ddd864b1a91deb2 (patch) | |
| tree | c4f64ac9b6d57e173b3afc7f412d783377f98db5 /src/util | |
| parent | f8966f9e867dc72080355342aab64734f70ac4f7 (diff) | |
Change SipHash2-4 -> SipHash1-3 (#780)
This seems to significantly improves performance. Inspired by https://github.com/rust-lang/rust/pull/107925
Diffstat (limited to 'src/util')
| -rw-r--r-- | src/util/mod.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util/mod.rs b/src/util/mod.rs index c2b23273..b8bf90d2 100644 --- a/src/util/mod.rs +++ b/src/util/mod.rs @@ -12,7 +12,7 @@ use std::num::NonZeroUsize; use std::path::{Component, Path, PathBuf}; use std::sync::Arc; -use siphasher::sip128::{Hasher128, SipHasher}; +use siphasher::sip128::{Hasher128, SipHasher13}; /// Turn a closure into a struct implementing [`Debug`]. pub fn debug<F>(f: F) -> impl Debug @@ -35,7 +35,7 @@ where /// Calculate a 128-bit siphash of a value. pub fn hash128<T: Hash + ?Sized>(value: &T) -> u128 { - let mut state = SipHasher::new(); + let mut state = SipHasher13::new(); value.hash(&mut state); state.finish128().as_u128() } |
