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 --- cli/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cli/src') diff --git a/cli/src/main.rs b/cli/src/main.rs index c62900e7..924ea9d7 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -17,7 +17,7 @@ use memmap2::Mmap; use notify::{RecommendedWatcher, RecursiveMode, Watcher}; use once_cell::unsync::OnceCell; use same_file::{is_same_file, Handle}; -use siphasher::sip128::{Hasher128, SipHasher}; +use siphasher::sip128::{Hasher128, SipHasher13}; use termcolor::{ColorChoice, StandardStream, WriteColor}; use typst::diag::{FileError, FileResult, SourceError, StrResult}; use typst::eval::Library; @@ -535,7 +535,7 @@ impl PathHash { fn new(path: &Path) -> FileResult { let f = |e| FileError::from_io(e, path); let handle = Handle::from_path(path).map_err(f)?; - let mut state = SipHasher::new(); + let mut state = SipHasher13::new(); handle.hash(&mut state); Ok(Self(state.finish128().as_u128())) } -- cgit v1.2.3