Performance regression: Preparing IntegrityMetaComponent
s after BOM processing takes too long
#1306
Labels
component/api-server
defect
Something isn't working
p2
Non-critical bugs, and features that help organizations to identify and reduce risk
performance
size/L
High effort
Milestone
Current Behavior
While porting #3357 I noticed that the section that is "preparing"
IntegrityMetaComponent
s is executing a transaction for every single component of the processed BOM:https://github.com/DependencyTrack/hyades-apiserver/blob/0dbf1d376c9e1a984e7c0bc735db1504c6de5aed/src/main/java/org/dependencytrack/tasks/BomUploadProcessingTask.java#L410-L425
Profiling the
informWithBloatedBomTest
confirmed my suspicion that this ends up being super expensive:Querying and creating the
IntegrityMetaComponent
s takes more CPU time than the actual BOM processing itself. And this is with API server and database residing on the same machine, it will be even more impactfull when that is not the case.Steps to Reproduce
informWithBloatedBomTest
with profilingExpected Behavior
Preparing
IntegrityMetaComponent
s should be a quick operation. It should not create a transaction for every component in the BOM.It's likely that the entire operation can be achieved with a single batch insert using JDBI.
Hyades Version
hyades-apiserver 5.5.0-SNAPSHOT
Repository Type
Hyades apiserver
Browser
N/A
Checklist
The text was updated successfully, but these errors were encountered: