Replace jwalk with a work-stealing directory walker - #355
Merged
Conversation
Byron
force-pushed
the
workstealing
branch
4 times, most recently
from
July 31, 2026 09:29
f135b36 to
1b6987f
Compare
Byron
marked this pull request as ready for review
July 31, 2026 09:29
Byron
force-pushed
the
workstealing
branch
2 times, most recently
from
July 31, 2026 09:33
cc66e48 to
a9ad7d0
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1b6987f63c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…0% more scan speed <!-- agent --> Replace jwalk and Rayon with a crate-local walker built on crossbeam-deque and standard-library threads. Directory reads and metadata collection run on stealable worker queues, while a bounded channel limits completed batches held ahead of the iterator. The walker never follows symlinks and no longer sorts entries because consumers sort their final results where needed. Provide two delivery modes on the shared implementation: aggregate scans and recursive deletion use completion order for maximum throughput and continuous progress; interactive traversal uses parent-first delivery so ancestor sizes and entry counts grow throughout the scan. Recursive deletion remains parallel through scoped standard-library workers. Raise the macOS default from three to eight filesystem workers based on warm-cache measurements. Assisted-by: GPT 5.6 Co-authored-by: GPT 5.6 <codex@openai.com>
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.
Tasks
Created by Codex on behalf of Byron. Byron will review before this is ready to merge.
Summary
jwalkand Rayon with an in-tree directory walker backed bycrossbeam-dequework stealing.Context
The iterator facade keeps ordering out of the worker scheduler: workers discover and prepare directory batches in parallel, while consumers only observe a directory after its complete batch is available and sorted. This avoids the previous handbrake where traversal order constrained discovery.
Advantages include removing two dependencies, sharing one traversal implementation across commands, retaining deterministic output, and improving measured scan time on
/Users/byron/dev/github.com. The main tradeoffs are more in-tree concurrency code to maintain, one buffered result per discovered directory until consumed, and a platform-specific default chosen from local hardware measurements rather than dynamic tuning.An attempted explicit parker/unparker wake-up path did not improve the benchmark and was omitted.
Validation
cargo fmt --allcargo clippy --all-targets --all-featurescargo test --all-targets --all-features(85 tests)git diff --check/Users/byron/dev/github.comwith--count-hard-links: about 29.9s at 3 threads, 18.9s at 6, 18.0s at 8, 17.6s at 10, 20.9s at 12, and 22.9s at 16.User Prompts