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

Update/iterator efficiently: Improving Memory #76

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

viveksahu26
Copy link
Contributor

The PR introduces a memory-efficient solution by implementing an iterator-based approach. Here’s how it works:

  • Lazy Loading: Instead of loading all SBOMs into memory at once, the updated sbomProcessing function uses an iterator to fetch and process SBOMs one at a time. This ensures that only a single SBOM resides in memory at any given moment, and reducing the overall memory consumption.
  • On-Demand Conversion: The PR includes a ConvertingSBOMIterator struct that wraps the original iterator. When the destination is Dependency-Track (Dtrack), this iterator converts each SBOM to the required format (CycloneDX) only when it’s needed—lazily, rather than upfront. For other destinations, it skips the conversion entirely, avoiding unnecessary memory use.

Signed-off-by: Vivek Kumar Sahu <[email protected]>
Signed-off-by: Vivek Kumar Sahu <[email protected]>
Signed-off-by: Vivek Kumar Sahu <[email protected]>
Signed-off-by: Vivek Kumar Sahu <[email protected]>
@viveksahu26 viveksahu26 changed the title Update/iterator efficiently Update/iterator efficiently: Improving Memory Mar 8, 2025
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.

1 participant