perf: use blake3 mmap_rayon for file hashing — zero heap allocation

- Replace std::fs::read() + update_rayon() with update_mmap_rayon()
  for file hashing, eliminating full-file heap allocation (500MB file
  no longer needs 500MB of RAM to hash)
- Enable blake3 'mmap' feature in Cargo.toml
- Lower hash_bytes rayon threshold from 10MB to 128KB
- Remove dead constants HASH_BLOCK_SIZE and RAYON_HASH_THRESHOLD
This commit is contained in:
Dionisio
2026-03-06 22:14:43 +01:00
parent 6e9c88f06c
commit 3d4156673c
3 changed files with 20 additions and 34 deletions
Generated
+10
View File
@@ -278,6 +278,7 @@ dependencies = [
"cfg-if",
"constant_time_eq",
"cpufeatures",
"memmap2",
"rayon-core",
]
@@ -1608,6 +1609,15 @@ version = "2.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79"
[[package]]
name = "memmap2"
version = "0.9.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "714098028fe011992e1c3962653c96b2d578c4b4bce9036e15ff220319b1e0e3"
dependencies = [
"libc",
]
[[package]]
name = "mimalloc"
version = "0.1.48"