From d0afba959d18d1c2c646b99e6ddd864b1a91deb2 Mon Sep 17 00:00:00 2001 From: Daniel Csillag Date: Wed, 19 Apr 2023 08:16:03 -0300 Subject: Change SipHash2-4 -> SipHash1-3 (#780) This seems to significantly improves performance. Inspired by https://github.com/rust-lang/rust/pull/107925 --- src/util/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/util') 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) -> impl Debug @@ -35,7 +35,7 @@ where /// Calculate a 128-bit siphash of a value. pub fn hash128(value: &T) -> u128 { - let mut state = SipHasher::new(); + let mut state = SipHasher13::new(); value.hash(&mut state); state.finish128().as_u128() } -- cgit v1.2.3