-
Notifications
You must be signed in to change notification settings - Fork 665
DYN-9675 Remove use of LINQ in hot path for DEP_Hander calls in AssociativeGraph.cs #16592
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-9675 Remove use of LINQ in hot path for DEP_Hander calls in AssociativeGraph.cs #16592
Conversation
(cherry picked from commit f7eaebc)
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.
Pull Request Overview
This PR optimizes performance-critical code in the Dynamo VM by removing LINQ operations and reducing allocations in the DEP_Handler function path. The changes focus on improving execution speed and memory efficiency for graph execution scenarios with high call volumes.
- Replaces LINQ
FirstOrDefaultcalls with manual for loops to avoid iterator overhead - Eliminates unnecessary temporary variable allocations in hot path execution
- Moves variable declarations closer to their usage to improve code clarity
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.
See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-9675
reddyashish
left a comment
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.
Nice. Looks good with one comment.
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.
Pull Request Overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
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.
Pull Request Overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
…iativeGraph.cs (DynamoDS#16592) Co-authored-by: Aparajit Pratap <[email protected]>
…alls in AssociativeGraph.cs (#16592) (#16625) Co-authored-by: Craig Long <[email protected]>
Purpose
DYN-9675
This PR goal is to improve throughput of the DEP_Handler function in the Dynamo VM. DEP_Handler is a function called on the hot path of graph execution multiple time for each function call within a node (ie multiple times per replication calls). This PR attempts to improve the speed of those calls and improve the memory efficiency. Specifically:
FirstOrDefaultusageThe result of the PR in one test graph (with over 2million calls to DEP_Handler) reduces the time by ~.5s or 5% of graph execution as follows:
master:


PR:
For the same test graph, the memory changes are as follows:
master:


PR:
Declarations
Check these if you believe they are true
Release Notes
VM Performance improvements
Reviewers
FYIs