perf: contrib.bom.utils.BomDependencyGraphFlatMerger._flatten_merge#999
Conversation
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
There was a problem hiding this comment.
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
seencontainer fromlist[int]toset[int]to makeid(todo) in seenchecks O(1) instead of O(n). - Update the corresponding mutation from
append()toadd().
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
🟢 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%) 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.
caused by #997 (comment)