feat: Faster scanning#13
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Improves scan performance by parallelizing manifest cataloging and reusing shared tool caches during a scan.
Changes:
- Parallelize
catalogByGlobwith a bounded worker pool and preserve deterministic output ordering. - Use scan-wide temporary caches for
uvandnpminvocations 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.
dreadn0ught
approved these changes
Jun 25, 2026
andyossprey
reviewed
Jun 25, 2026
| if n, err := strconv.Atoi(strings.TrimSpace(os.Getenv("OSSPREY_SCAN_CONCURRENCY"))); err == nil && n > 0 { | ||
| return n | ||
| } | ||
| return 8 |
Contributor
There was a problem hiding this comment.
Default should be runtime.NumCPU
Contributor
Author
There was a problem hiding this comment.
They're saying the expensive part is network and CPU just spends a bunch of time waiting
andyossprey
approved these changes
Jun 25, 2026
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.
No description provided.