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
+1 -1
View File
@@ -40,7 +40,7 @@ image = { version = "0.25", default-features = false, features = ["jpeg", "png",
kamadak-exif = "0.5"
md-5 = "0.10"
sha2 = "0.10.9"
blake3 = { version = "1.8.3", features = ["rayon"] }
blake3 = { version = "1.8.3", features = ["rayon", "mmap"] }
hex = "0.4.3"
http-body-util = "0.1.3"
percent-encoding = "2.3"