-
Notifications
You must be signed in to change notification settings - Fork 587
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Use single license scanner for all catalogers #3348
Merged
Merged
Conversation
This file contains 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
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
wagoodman
force-pushed
the
single-license-scanner
branch
from
October 18, 2024 20:58
7431129
to
8f58814
Compare
The fix is certainly comparable to the performance of the previous release.
grype v0.81.0
grype v0.82.0
grype v0.82.1
grype fix - pr 3348
|
kzantow
approved these changes
Oct 21, 2024
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
willmurphyscode
approved these changes
Oct 21, 2024
wagoodman
changed the title
Create single license scanner for all catalogers
Use single license scanner for all catalogers
Oct 21, 2024
HeyeOpenSource
added a commit
to HeyeOpenSource/syft
that referenced
this pull request
Oct 22, 2024
…gers (anchore#3348)](anchore@e4e985b) by Alex Goodman <wagoodman@users.noreply.github.com> Signed-off-by: HeyeOpenSource <opensource@heye-international.com>
# for free
to join this conversation on GitHub.
Already have an account?
# 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.
Description
Extends work from #3290 by still not leveraging the static license change object (to prevent the GC from holding onto license classifier objects in static space) but also not creating the same scanner often (which results in poor CPU performance). Instead this approach uses a single scanner instance that is scoped to the context object created within the
CreateSBOM()
top-level API function. Since thelicenses.Search()
path is invoked several times, it's important to not create license scanner objects within that function, but instead, pass a new scanner object. This allows for the caller to swap strategies and provide configuration to get different behaviors in license scanning. That being said -- this configuration has NOT been exposed on the API, as the newlicenses.Scanner
is in an internal package, however, in the future we can elevate this to thepkg/license
package and expose a new builder function on the top-level APICreateSBOMConfig
, but this has been deferred until later.Type of change
Checklist: