You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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:
Remove use of LINQ FirstOrDefault usage
Simplify unnecessary allocation of temporary variables.
The 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:
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 FirstOrDefault calls 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
github-actionsbot
changed the title
Remove use of LINQ in hot path for DEP_Hander calls in AssociativeGraph.cs
DYN-9675: Remove use of LINQ in hot path for DEP_Hander calls in AssociativeGraph.cs
Oct 14, 2025
saintentropy
changed the title
DYN-9675: Remove use of LINQ in hot path for DEP_Hander calls in AssociativeGraph.cs
DYN-9675 Remove use of LINQ in hot path for DEP_Hander calls in AssociativeGraph.cs
Oct 14, 2025
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