Skip to content

Conversation

@G-Rath
Copy link
Collaborator

@G-Rath G-Rath commented Jan 7, 2026

I'm a little suspect of the results I've produced, but it seems like this reduces memory usage by a decent amount e.g. with the Ubuntu SBOM used for #2217 we go from 1gb to 200mb total.

Ultimately, I think the theory is sound and that are not really any downsides so we might as well change this.

Note that this does not have any impact on scanning speed, just memory usage.

@G-Rath G-Rath changed the title perf(local) don't read the entire zip into memory perf(local): don't read the entire zip into memory Jan 7, 2026
@G-Rath G-Rath marked this pull request as ready for review January 7, 2026 21:53
@codecov-commenter
Copy link

codecov-commenter commented Jan 7, 2026

Codecov Report

❌ Patch coverage is 71.42857% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.79%. Comparing base (cc37ac7) to head (23f4f17).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
internal/clients/clientimpl/localmatcher/zip.go 71.42% 5 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2445      +/-   ##
==========================================
- Coverage   67.83%   67.79%   -0.04%     
==========================================
  Files         172      172              
  Lines       13290    13301      +11     
==========================================
+ Hits         9015     9018       +3     
- Misses       3569     3573       +4     
- Partials      706      710       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@G-Rath G-Rath requested a review from another-rex January 8, 2026 02:34
@another-rex another-rex merged commit b11d671 into google:main Jan 8, 2026
17 checks passed
@another-rex another-rex deleted the perf/improve branch January 8, 2026 03:52
G-Rath added a commit that referenced this pull request Jan 9, 2026
Since #2445 has us stream bytes to and from disk rather than writing the
entire contents in one go, it's no longer safe for tests to be using the
databases in parallel so we always need to use a unique directory
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.

3 participants