Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(spdx-utils): Fix a performance issue in
SpdxExpression::and()
31b9be8 introduced an `equals()` into `SpdxCompoundExpression::and`. For packages with large amounts of detected licenses including ones with `OR` operators, the performance of the `and` function becomes so poor that the evaluator runs for 3 days (with the open source `ort-config` rules, without terminating. Also the reporter performance degrades from less than 30 seconds to 3 hours. Unfortunately the call tree involved is so complicated that there is no simple fix for this. `equals()` involves recursive `validChoices()` calls which in turn call `equals()` again when computing distinctness or inserting further `SpdxExpressions` into sets. Revert the change to fix the problem in a timely manner. Note that it makes sense to bring back the now reverted functionality, but the code should be refactored first to produce more managable call trees. Fixes: #9902. This reverts commit 31b9be8. Signed-off-by: Frank Viernau <[email protected]>
- Loading branch information