Improve detection graph traversal for large result sets#1401
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1401 +/- ##
=====================================
Coverage 89.7% 89.7%
=====================================
Files 401 402 +1
Lines 31875 31930 +55
Branches 1972 1977 +5
=====================================
+ Hits 28593 28647 +54
Misses 2863 2863
- Partials 419 420 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
👋 Hi! It looks like you modified some files in the
If none of the above scenarios apply, feel free to ignore this comment 🙂 |
What about the before/after for CG runtime itself? |
This repo is open source, and details for implementations that consume these binaries are kept out of here. The time savings should still apply for any libraries that are running these component detection binaries. |
Basically, I was just asking the runtime spent by the CG itself, before and after your changes. It's because you mention the whole CD runtimes, but I'm curious about the CG portion itself. |
When a large number of results are returned from detection, there was a massive slowdown in
GatherSetOfDetectedComponentsUnmerged. Investigation proved that the bottleneck was during thecomponentRecorder.GetComponentcall that was invoked to convert a string to aTypedComponentwhen adding the roots and ancestors of each component to the result set:This change makes it so that we iterate over all of the components in each dependency graph, and run
componentRecorder.GetComponenta single time on each component in the dependency graph. Then, we use thatTypedComponentas the return type for the calculate ancestor/roots call.Overall, for a large repository with 3600 Nuget dependency graphs and 2200 Nuget components, this change reduces the total CD runtime from ~28 minutes to ~8 minutes, with 0 change in the resulting manifest file.