Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve LanguageByName and add unit tests #1034

Merged
merged 1 commit into from
Jun 7, 2022

Conversation

westonsteimel
Copy link
Contributor

@westonsteimel westonsteimel commented Jun 6, 2022

Getting a syft Language struct by string name wasn't working as expected for rust, ruby, or dart, so this fixes that and adds unit tests for the LanguageByName function.

Signed-off-by: Weston Steimel weston.steimel@anchore.com

Signed-off-by: Weston Steimel <weston.steimel@anchore.com>
@github-actions
Copy link

github-actions bot commented Jun 6, 2022

Benchmark Test Results

Benchmark results from the latest changes vs base branch
name                                                       old time/op    new time/op    delta
ImagePackageCatalogers/ruby-gemspec-cataloger-2              1.46ms ± 8%    1.15ms ± 2%  -21.42%  (p=0.008 n=5+5)
ImagePackageCatalogers/python-package-cataloger-2            3.47ms ± 2%    2.94ms ± 2%  -15.31%  (p=0.008 n=5+5)
ImagePackageCatalogers/php-composer-installed-cataloger-2    1.13ms ± 2%    0.94ms ± 0%  -17.28%  (p=0.016 n=5+4)
ImagePackageCatalogers/javascript-package-cataloger-2         746µs ± 1%     624µs ± 0%  -16.34%  (p=0.008 n=5+5)
ImagePackageCatalogers/dpkgdb-cataloger-2                     899µs ± 1%     772µs ± 0%  -14.15%  (p=0.008 n=5+5)
ImagePackageCatalogers/rpmdb-cataloger-2                      858µs ± 1%     763µs ± 1%  -11.12%  (p=0.008 n=5+5)
ImagePackageCatalogers/java-cataloger-2                      16.2ms ± 1%    13.3ms ± 1%  -17.66%  (p=0.008 n=5+5)
ImagePackageCatalogers/apkdb-cataloger-2                     1.30ms ± 1%    1.30ms ± 5%     ~     (p=0.690 n=5+5)
ImagePackageCatalogers/go-module-binary-cataloger-2          2.55µs ± 0%    2.17µs ± 1%  -14.84%  (p=0.008 n=5+5)
ImagePackageCatalogers/dotnet-deps-cataloger-2               1.46ms ± 1%    1.30ms ± 4%  -11.18%  (p=0.008 n=5+5)

name                                                       old alloc/op   new alloc/op   delta
ImagePackageCatalogers/ruby-gemspec-cataloger-2               184kB ± 0%     184kB ± 0%     ~     (p=0.548 n=5+5)
ImagePackageCatalogers/python-package-cataloger-2             890kB ± 0%     889kB ± 0%     ~     (p=0.421 n=5+5)
ImagePackageCatalogers/php-composer-installed-cataloger-2     195kB ± 0%     196kB ± 0%     ~     (p=0.421 n=5+5)
ImagePackageCatalogers/javascript-package-cataloger-2         140kB ± 0%     140kB ± 0%     ~     (p=0.151 n=5+5)
ImagePackageCatalogers/dpkgdb-cataloger-2                     184kB ± 0%     184kB ± 0%     ~     (p=1.000 n=5+5)
ImagePackageCatalogers/rpmdb-cataloger-2                      215kB ± 0%     215kB ± 0%   +0.06%  (p=0.008 n=5+5)
ImagePackageCatalogers/java-cataloger-2                      3.27MB ± 0%    3.28MB ± 0%   +0.11%  (p=0.008 n=5+5)
ImagePackageCatalogers/apkdb-cataloger-2                     1.23MB ± 0%    1.23MB ± 0%     ~     (p=0.421 n=5+5)
ImagePackageCatalogers/go-module-binary-cataloger-2            672B ± 0%      672B ± 0%     ~     (all equal)
ImagePackageCatalogers/dotnet-deps-cataloger-2                351kB ± 0%     351kB ± 0%   -0.06%  (p=0.016 n=5+5)

name                                                       old allocs/op  new allocs/op  delta
ImagePackageCatalogers/ruby-gemspec-cataloger-2               3.71k ± 0%     3.70k ± 0%     ~     (p=0.333 n=4+5)
ImagePackageCatalogers/python-package-cataloger-2             14.9k ± 0%     14.9k ± 0%     ~     (p=0.810 n=5+5)
ImagePackageCatalogers/php-composer-installed-cataloger-2     4.98k ± 0%     4.98k ± 0%     ~     (p=1.000 n=5+5)
ImagePackageCatalogers/javascript-package-cataloger-2         2.76k ± 0%     2.76k ± 0%     ~     (all equal)
ImagePackageCatalogers/dpkgdb-cataloger-2                     4.04k ± 0%     4.04k ± 0%     ~     (all equal)
ImagePackageCatalogers/rpmdb-cataloger-2                      5.26k ± 0%     5.26k ± 0%     ~     (all equal)
ImagePackageCatalogers/java-cataloger-2                       52.6k ± 0%     52.6k ± 0%     ~     (p=0.421 n=5+5)
ImagePackageCatalogers/apkdb-cataloger-2                      4.87k ± 0%     4.87k ± 0%     ~     (p=0.683 n=5+5)
ImagePackageCatalogers/go-module-binary-cataloger-2            15.0 ± 0%      15.0 ± 0%     ~     (all equal)
ImagePackageCatalogers/dotnet-deps-cataloger-2                6.72k ± 0%     6.72k ± 0%     ~     (all equal)

@westonsteimel westonsteimel merged commit 05be9e2 into main Jun 7, 2022
@westonsteimel westonsteimel deleted the improve-language-by-name branch June 7, 2022 13:09
spiffcs added a commit to jonasagx/syft that referenced this pull request Jun 27, 2022
* main: (70 commits)
  fix: add php catalogers to all catalogers (anchore#1065)
  feat: add use-all-catalogers flag (anchore#1050)
  Updates parsing of `yarn.lock` to use `resolved` URLs that are pulled from yarn and npm registries (anchore#926)
  remove OSS Meetup message (anchore#1057)
  add pom.xml cataloger (anchore#1055)
  Add support for CBL-Mariner distroless images (anchore#1045)
  Add catalogers configuration (anchore#1038)
  add template output (anchore#1051)
  update stereoscope to latest version (anchore#1052)
  update zip_read_closer to incorporate zip64 support (anchore#1041)
  Add pacman (alpm) parser support (anchore#943)
  Update of README.md (anchore#1027)
  bump cosign to v1.9.0 to resolve reporting of GHSA-66x3-6cw3-v5gj (anchore#1025)
  add workflows to test new project automation (anchore#1023)
  improve LanguageByName and add unit tests (anchore#1034)
  Read Description from dpkg status files (anchore#996)
  Add announcement for Anchore OSS Virtual Meetup (anchore#1033)
  add main module field to go bin metadata (anchore#1026)
  Add filters to package cataloger (anchore#1021)
  change draft to false for release process (anchore#1016)
  ...

Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
aiwantaozi pushed a commit to aiwantaozi/syft that referenced this pull request Oct 20, 2022
Signed-off-by: Weston Steimel <weston.steimel@anchore.com>
GijsCalis pushed a commit to GijsCalis/syft that referenced this pull request Feb 19, 2024
Signed-off-by: Weston Steimel <weston.steimel@anchore.com>
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.

None yet

2 participants