Repository navigation
perf: run cache scanners alongside the project walk and parallelize walking and sizing - #72
Merged
Merged
Conversation
…ge artifacts across workers Stat scanners (global caches, Xcode, Docker, LLM stores) now run in a second lane next to the project walk instead of after it, and measure walks subdirectories of one artifact in parallel while one of 8 process-wide slots is free, so a lone large artifact such as a pnpm store is no longer sized by one goroutine. Sub-walks share one hard-link and clone tally, so totals are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fy lane code - sizePending workers now wait for a slot of the same 8-slot limit the sub-walks take, so both lanes' pools and the sub-walks together run at most 8 sizing walks instead of up to 24. - measure classifies a file before taking its lock once, instead of three lock sites and derived flags. - ScanWithProgress keeps the first lane error with sync.Once instead of filtering context.Canceled afterwards, and names its progress counters. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the walk and the stat scanners running together, the spinner kept the name of the last stat scanner that started while the project walk went on. Progress now names every lane still running. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The project walk read every directory under the scan root with one goroutine. A directory it would descend into is now handed to its own goroutine, with a copy of the ancestors' project contexts, while one of 8 walk slots is free. Results are still sorted by (table order, path). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 28, 2026
…/concurrent-scan # Conflicts: # internal/scanner/scanner.go
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- cancel the other lane with context.WithCancelCause instead of a hand-rolled first error - share one progress callback between the lanes - bound sizing only by its slots and give the walk its own slot count - state that Walker hooks must not modify a shared parent state Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.
What changed
fstreewalks subdirectories in other goroutines when given slots; each directory hands its subdirectories their state (the project walk's context stack) instead of a shared stack with a Leave hook.Output is unchanged: results keep the same order and sizes.
Why
The cache lane (~21 s) waited for the project walk (~22–27 s), and each ran on one goroutine.
Result (warm cache)
Full home scan: 64–77 s → 28–35 s.
Docs
docs/ARCHITECTURE.md: pipeline step 1, sizing limit, § Shared traversal, § Walk engine.🤖 Generated with Claude Code