perf: parallelize scan stat pass, mmap dupe hashing, parallel dir removal (0.5.0) - #2
Merged
Merged
Conversation
… removal The scan's per-file size stat ran serially in the consumer loop even though jwalk walked in parallel, so hundreds of thousands of stat syscalls hit one thread — the whole scan cost. Move the stat into jwalk's process_read_dir (WalkDirGeneric client_state) so sizes are read on the parallel walk workers; the consumer just reads the cached size. Nothing on the scan hot path is sequential anymore. - dupes: full BLAKE3 hash now memory-maps the file (update_mmap, blake3 "mmap" feature) so large files hash straight from the page cache with no buffered-read syscalls or copies. Streaming fallback for empty/special files. - delete: directory removal is no longer a serial loop — dirs are grouped by depth and each level is removed in parallel (siblings are independent), deepest level first so a dir is always empty when removed. Bump 0.4.0 -> 0.5.0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes the whole pipeline parallel — no serial hot path left.
process_read_dir(WalkDirGenericclient_state) so sizes are read on the parallel walk workers; the consumer just reads the cached size.update_mmaps the file (blake3mmapfeature) — large files hash straight from the page cache, no buffered-read syscalls/copies. Streaming fallback for empty/special files.Bump 0.4.0 → 0.5.0. Compile-checked (core+cli); full build to CI.