Skip to content

perf: contrib.bom.utils.BomDependencyGraphFlatMerger._flatten_merge#999

Merged
jkowalleck merged 1 commit into
mainfrom
perf/contrib-bom-utils-BomDependencyGraphFlatMerger-_flatten_merge
Jun 11, 2026
Merged

perf: contrib.bom.utils.BomDependencyGraphFlatMerger._flatten_merge#999
jkowalleck merged 1 commit into
mainfrom
perf/contrib-bom-utils-BomDependencyGraphFlatMerger-_flatten_merge

Conversation

@jkowalleck

Copy link
Copy Markdown
Member

caused by #997 (comment)

Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the runtime performance of cyclonedx.contrib.bom.utils.BomDependencyGraphFlatMerger._flatten_merge by optimizing how already-visited Dependency objects are tracked during graph traversal, addressing feedback from the earlier introduction of this utility (#997).

Changes:

  • Replace the seen container from list[int] to set[int] to make id(todo) in seen checks O(1) instead of O(n).
  • Update the corresponding mutation from append() to add().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codacy-production

codacy-production Bot commented Jun 11, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

🟢 Coverage 100.00% diff coverage · +0.00% coverage variation

Metric Results
Coverage variation +0.00% coverage variation
Diff coverage 100.00% diff coverage (80.00%)

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (78b8d8b) 6078 5728 94.24%
Head commit (372a36a) 6078 (+0) 5728 (+0) 94.24% (+0.00%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#999) 2 2 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@jkowalleck jkowalleck merged commit a8579b8 into main Jun 11, 2026
54 checks passed
@jkowalleck jkowalleck deleted the perf/contrib-bom-utils-BomDependencyGraphFlatMerger-_flatten_merge branch June 11, 2026 10:17
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.

2 participants