Skip to main content

should_use_parallel

Function should_use_parallel 

Source
pub fn should_use_parallel(paths: &[&Path]) -> bool
Expand description

Check if parallel hashing is worthwhile for the given file paths. Always parallelizes with 2+ files — rayon’s thread pool is already initialized and work-stealing overhead is minimal (~1µs per file dispatch). With mmap, each thread independently maps and hashes its own file with no shared state, giving near-linear speedup with available cores.