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 /cli | |
| 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 'cli')
| -rw-r--r-- | cli/src/main.rs | 4 |
1 files changed, 2 insertions, 2 deletions
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<Self> { 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())) } |
