Rust library to generate static websites
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf(assets): Improve hashing performance

+21 -4
+5
.sampo/changesets/jovial-thunderbearer-kullervo.md
··· 1 + --- 2 + cargo/maudit: patch 3 + --- 4 + 5 + Improve hashing performance
+10 -1
Cargo.lock
··· 2567 2567 "oxipng", 2568 2568 "pathdiff", 2569 2569 "pulldown-cmark", 2570 + "rapidhash", 2570 2571 "rayon", 2571 2572 "rustc-hash", 2572 2573 "serde", ··· 2577 2578 "thumbhash", 2578 2579 "tokio", 2579 2580 "webp", 2580 - "xxhash-rust", 2581 2581 ] 2582 2582 2583 2583 [[package]] ··· 4056 4056 checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" 4057 4057 dependencies = [ 4058 4058 "getrandom 0.3.4", 4059 + ] 4060 + 4061 + [[package]] 4062 + name = "rapidhash" 4063 + version = "4.1.1" 4064 + source = "registry+https://github.com/rust-lang/crates.io-index" 4065 + checksum = "d8e65c75143ce5d47c55b510297eeb1182f3c739b6043c537670e9fc18612dae" 4066 + dependencies = [ 4067 + "rustversion", 4059 4068 ] 4060 4069 4061 4070 [[package]]
+1 -1
crates/maudit/Cargo.toml
··· 46 46 thiserror = "2.0.9" 47 47 oxc_sourcemap = "4.1.0" 48 48 rayon = "1.11.0" 49 - xxhash-rust = "0.8.15" 49 + rapidhash = "4.1.1" 50 50 pathdiff = "0.2.3"
+5 -2
crates/maudit/src/assets.rs
··· 1 1 use log::debug; 2 + use rapidhash::fast::RapidHasher; 2 3 use rustc_hash::FxHashSet; 4 + use std::hash::Hasher; 3 5 use std::path::Path; 4 6 use std::time::Instant; 5 7 use std::{fs, path::PathBuf}; 6 - use xxhash_rust::xxh3::xxh3_64; 7 8 8 9 mod image; 9 10 pub mod image_cache; ··· 491 492 } 492 493 } 493 494 494 - let hash = xxh3_64(&buf); // one-shot, much faster than streaming 495 + let mut hasher = RapidHasher::default(); 496 + hasher.write(&buf); 497 + let hash = hasher.finish(); // one-shot, much faster than streaming 495 498 496 499 debug!( 497 500 "Calculated hash for asset {:?} in {:?}",