Skip to main content

Module incremental

Module incremental 

Source
Expand description

Incremental diffing with result caching.

This module provides caching and incremental computation for SBOM diffs, dramatically improving performance when comparing related SBOMs (e.g., successive builds where only a few components change).

§How It Works

  1. Content Hashing: Each SBOM section (components, dependencies, licenses, vulnerabilities) has a separate content hash.
  2. Change Detection: Before recomputing, we check if each section changed.
  3. Partial Recomputation: Only sections that changed are recomputed.
  4. Result Caching: Full results are cached for exact SBOM pair matches.

§Performance Gains

  • Exact cache hit: O(1) lookup
  • Partial change: Only recompute changed sections (typically 10-50% of work)
  • Cold start: Same as regular diff

Structs§

CacheStats
Statistics for cache performance.
CachedDiffResult
A cached diff result with metadata.
ChangedSections
Indicates which sections changed between two SBOMs.
DiffCache
Thread-safe cache for diff results.
DiffCacheConfig
Configuration for the diff cache.
DiffCacheKey
Key for full diff cache lookup.
IncrementalDiffEngine
A diff engine wrapper that supports incremental computation and caching.
IncrementalDiffResult
Result of an incremental diff operation.
SectionHashes
Section-level hashes for incremental change detection.

Enums§

CacheHitType
Type of cache hit achieved.