perf(licenses): prefetch remote licenses concurrently for js lockfiles - #5223
Draft
CAOShurong wants to merge 1 commit into
Draft
perf(licenses): prefetch remote licenses concurrently for js lockfiles#5223CAOShurong wants to merge 1 commit into
CAOShurong wants to merge 1 commit into
Conversation
Contributor
Author
|
Marked as draft while CI runs — will mark ready for review once checks pass. Full description below. ProblemWith The lookups are independent of one another, so there is no reason for them to serialize. Change
Dev-dependency filtering and alias handling are applied before building the pair list, so no extra requests are issued for packages that would be skipped anyway. Verification
|
CAOShurong
force-pushed
the
codex/5193-concurrent-enrich
branch
from
August 24, 2026 11:57
8c24761 to
2909922
Compare
With --enrich javascript (or search-remote-licenses), each package constructor performed its own npm registry request inline, so a lockfile with N entries made N strictly sequential HTTP round-trips. For a 1500-package pnpm-lock.yaml this dominated scan time (see anchore#5193). Collect the (name, version) pairs during parsing and warm a per-parse in-memory cache with bounded-concurrency lookups (8 workers) before the package constructors run; constructors then resolve locally, falling back to the original inline request when an entry was not prefetched. Also treat 404 from the registry as an explicit error instead of trying to decode an error document as JSON. Fixes anchore#5193 Signed-off-by: Shurong Cao <CAOShurong@users.noreply.github.com>
CAOShurong
force-pushed
the
codex/5193-concurrent-enrich
branch
from
August 24, 2026 12:02
2909922 to
bc6719d
Compare
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.
Fixes #5193