Skip to content

fix(ScanSummary): Turn licenses into a lazy initialized property#7316

Merged
fviernau merged 1 commit into
mainfrom
lazy-liceses
Jul 20, 2023
Merged

fix(ScanSummary): Turn licenses into a lazy initialized property#7316
fviernau merged 1 commit into
mainfrom
lazy-liceses

Conversation

@fviernau

Copy link
Copy Markdown
Member

When the SPDX expressions are mapped into a MutableSet, then equals gets called on each added SPDX expression instance. Equals in turn calls validChoicesForDnf() which is quite slow.

Turn the property into a lazy one, to remove the performance penalty from code paths which do not access that licenses property.

When the SPDX expressions are mapped into a `MutableSet`, then `equals`
gets called on each added SPDX expression instance. Equals in turn calls
`validChoicesForDnf()` which is quite slow.

Turn the property into a lazy one, to remove the performance penalty
from code paths which do not access that `licenses` property.

Signed-off-by: Frank Viernau <frank_viernau@epam.com>
@fviernau fviernau requested a review from a team as a code owner July 20, 2023 07:07
@fviernau fviernau enabled auto-merge (rebase) July 20, 2023 07:07
@codecov

codecov Bot commented Jul 20, 2023

Copy link
Copy Markdown

Codecov Report

Patch and project coverage have no change.

Comparison is base (08ad744) 61.20% compared to head (c5de159) 61.20%.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #7316   +/-   ##
=========================================
  Coverage     61.20%   61.20%           
  Complexity     1969     1969           
=========================================
  Files           335      335           
  Lines         16489    16489           
  Branches       2350     2350           
=========================================
  Hits          10092    10092           
  Misses         5420     5420           
  Partials        977      977           
Flag Coverage Δ
funTest-docker 69.24% <ø> (ø)
test 36.58% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@fviernau fviernau disabled auto-merge July 20, 2023 08:05
@fviernau fviernau merged commit ffb9041 into main Jul 20, 2023
@fviernau fviernau deleted the lazy-liceses branch July 20, 2023 08:05
@fviernau

Copy link
Copy Markdown
Member Author

The failing test was unrelated, merge regardlessly.

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