perf(scanner): size stat scanners via the shared parallel worker pool - #23
Merged
Conversation
The global/xcode/llm scanners measured each artifact inline as they discovered it, so their per-directory sizing walks ran serially. Collect the artifacts first (stat only), then hand the whole batch to the same sizePending pool the walk engine already uses, so the tree-walk I/O overlaps. Sizes feed no discovery-time decision, so deferral is safe; enrichment and ordering rely on mtime/path, not size. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YSTf3ozF4SnboZHyEi7Ycc
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
The
global/xcode/llmstat scanners measured each artifact inline as they discovered it, so their per-directory sizing walks ran serially. They now collect artifacts first (stat only), then hand the whole batch to the samesizePendingbounded worker pool (min(NumCPU, 8)) that the walk engine already uses, so the tree-walk I/O overlaps.Why
Sizing a directory tree is I/O-bound; running each scanner's artifacts through the shared pool overlaps those walks instead of serializing them. This unifies the sizing strategy across both scanner families (walk + stat).
Safety
sized()is kept for the single-result path (used by sizing tests).Verified
go build·go vet·go test ./...·golangci-lint runall pass.scan --eco {global,xcode,llm} --jsonreports correct non-zero sizes after the change.🤖 Generated with Claude Code
https://claude.ai/code/session_01YSTf3ozF4SnboZHyEi7Ycc