Skip to content

perf(scanner): size stat scanners via the shared parallel worker pool - #23

Merged
ohing504 merged 1 commit into
mainfrom
perf/stat-parallel-sizing
Jul 17, 2026
Merged

perf(scanner): size stat scanners via the shared parallel worker pool#23
ohing504 merged 1 commit into
mainfrom
perf/stat-parallel-sizing

Conversation

@ohing504

Copy link
Copy Markdown
Owner

What

The global/xcode/llm stat 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 same sizePending bounded 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

  • Size feeds no discovery-time decision in any scanner (results are only appended); deferral is safe.
  • Enrichment and ordering rely on mtime/path, not size, so output stays deterministic.
  • sized() is kept for the single-result path (used by sizing tests).

Verified

  • go build · go vet · go test ./... · golangci-lint run all pass.
  • Functional: scan --eco {global,xcode,llm} --json reports correct non-zero sizes after the change.

🤖 Generated with Claude Code

https://claude.ai/code/session_01YSTf3ozF4SnboZHyEi7Ycc

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
@ohing504
ohing504 merged commit 2f81ae3 into main Jul 17, 2026
3 checks passed
@ohing504
ohing504 deleted the perf/stat-parallel-sizing branch July 17, 2026 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant