Index SBOM occurrences for parent lookup in graph build

What does this MR do and why?

find_parent_sbom_occurrence scanned every occurrence for each ancestor, which is quadratic in the number of occurrences for large projects.

This change introduces an in-memory index to make lookup O(1).

Related to #593156

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports

Loading
Loading