Repository navigation
refactor: remove dedicated copy thread pool - #1901
Merged
Merged
Conversation
The separate COPY_POOL was preventing copy I/O from sharing the global rayon pool, but there's no concurrent rayon work happening alongside copies in practice. Removes the pool, in_copy_pool(), and the copy_dir_recursive_inner indirection. Co-Authored-By: Claude <[email protected]>
worktrunk-bot
approved these changes
Apr 3, 2026
max-sixty
added a commit
that referenced
this pull request
Apr 4, 2026
The global rayon pool (2× CPU cores, tuned for network I/O in `wt list`) was being used for copy-ignored operations after #1901 removed the dedicated pool. This caused ~1000% CPU usage on copy-heavy operations that should be background work. Restores a 4-thread `LazyLock` pool internal to `copy_dir_recursive`. The public API is unchanged — no `in_copy_pool` wrapper needed since the pool entry happens inside `copy_dir_recursive` itself. Co-authored-by: Claude <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Apr 4, 2026
#1901 removed the dedicated copy pool, so `copy_dir_recursive` started using the global rayon pool (2× CPU cores, tuned for network I/O). This caused ~1000% CPU on copy-heavy operations like `wt step copy-ignored` with large `target/` directories. Restores a 4-thread `LazyLock` pool internal to `copy_dir_recursive` — no public API change needed. The pool is the same approach benchmarked in #1721 (performance peaks at 2–4 threads for disk I/O). > _This was written by Claude Code on behalf of @max-sixty_ Co-authored-by: Claude <[email protected]>
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.
The separate
COPY_POOL(LazyLock<rayon::ThreadPool>) isolated copy I/O from the global rayon pool. In practice there's no concurrent rayon work during copies, so the isolation added complexity without benefit. This removes the pool,in_copy_pool(), and thecopy_dir_recursive_innerindirection — copy operations now use the global rayon pool directly.Follows #1894 which introduced the static pool.