-
Notifications
You must be signed in to change notification settings - Fork 635
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DYN-4228 Convert StrongConnectComponent to use List vs Dictionary input type #10355
DYN-4228 Convert StrongConnectComponent to use List vs Dictionary input type #10355
Conversation
@@ -337,18 +337,17 @@ private bool CyclicDependencyTest(ProtoCore.AssociativeGraph.GraphNode node, ref | |||
return true; | |||
} | |||
|
|||
var indexMap = new Dictionary<GraphNode, int>(); | |||
var lowlinkMap = new Dictionary<GraphNode, int>(); | |||
var indexList = new int[codeBlock.instrStream.dependencyGraph.GraphList.Count]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the actual place where we're getting the perf improvement; since you are pre-allocating the size of the array in this case rather than initializing an empty dictionary that needs to be expanded every other time values are added to it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Waiting for PR checks and tests to pass before merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Waiting for PR checks and tests to pass before merging.
Purpose
https://jira.autodesk.com/browse/DYN-4228
The purpose of this PR is to remove a performance bottleneck that affect graphs with larger node quantities. In the graph compilation phase, cyclic dependencies in the graph logic are detected for error and warning purpose. Part of this detection process creates a numerous Dictionary collections which incurred significant time and memory allocation. This PR refactors the
StrongConnectComponent
method to utilize existing data found in the GraphNode object (specifically thedependencyGraphListID
property) vs the creation of new Map data structure for a lookup key.Declarations
Check these if you believe they are true
*.resx
filesReviewers
@mjkkirschner @aparajit-pratap
FYIs
@reddyashish