Skip to content

feat: Faster scanning#13

Merged
ossprey-valentino merged 2 commits into
mainfrom
VD-MuchFasterScan
Jun 26, 2026
Merged

feat: Faster scanning#13
ossprey-valentino merged 2 commits into
mainfrom
VD-MuchFasterScan

Conversation

@ossprey-valentino

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves scan performance by parallelizing manifest cataloging and reusing shared tool caches during a scan.

Changes:

  • Parallelize catalogByGlob with a bounded worker pool and preserve deterministic output ordering.
  • Use scan-wide temporary caches for uv and npm invocations to reduce repeated downloads/work.
  • Add tests to validate concurrency controls, deterministic ordering, and dedup behavior.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
internal/catalog/cataloger.go Adds configurable concurrency and parallel execution for glob-based cataloging while keeping deterministic output.
internal/catalog/uv_cataloger.go Introduces a shared uv cache directory for the cataloger run.
internal/catalog/setuppy_cataloger.go Introduces a shared uv cache directory for setup.py resolution runs.
internal/catalog/npm_cataloger.go Introduces a shared npm cache directory across the cataloger run and threads it into runNpmResolve.
internal/catalog/concurrency_test.go Adds tests covering concurrency default/override, deterministic ordering, and dedup under concurrency.
go.mod Adds golang.org/x/sync direct dependency for errgroup concurrency limiting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/catalog/cataloger.go
Comment thread internal/catalog/cataloger.go
if n, err := strconv.Atoi(strings.TrimSpace(os.Getenv("OSSPREY_SCAN_CONCURRENCY"))); err == nil && n > 0 {
return n
}
return 8

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default should be runtime.NumCPU

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They're saying the expensive part is network and CPU just spends a bunch of time waiting

@ossprey-valentino ossprey-valentino merged commit 2106262 into main Jun 26, 2026
7 checks passed
@ossprey-valentino ossprey-valentino deleted the VD-MuchFasterScan branch June 26, 2026 08:38
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.

4 participants