DYN-9675 Remove use of LINQ in hot path for DEP_Hander calls in AssociativeGraph.cs#16592
Merged
aparajit-pratap merged 5 commits intoDynamoDS:masterfrom Oct 22, 2025
Merged
Conversation
(cherry picked from commit f7eaebc)
Contributor
There was a problem hiding this comment.
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.
See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-9675
reddyashish
reviewed
Oct 14, 2025
Collaborator
reddyashish
left a comment
There was a problem hiding this comment.
Nice. Looks good with one comment.
zeusongit
approved these changes
Oct 15, 2025
reddyashish
approved these changes
Oct 16, 2025
aparajit-pratap
added a commit
to aparajit-pratap/Dynamo
that referenced
this pull request
Oct 22, 2025
…iativeGraph.cs (DynamoDS#16592) Co-authored-by: Aparajit Pratap <[email protected]>
3 tasks
reddyashish
pushed a commit
that referenced
this pull request
Oct 22, 2025
…alls in AssociativeGraph.cs (#16592) (#16625) Co-authored-by: Craig Long <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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