Reduce allocations and telemetry overhead in Fusion execution - #10093
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reduces per-node allocation and telemetry overhead in the Fusion execution pipeline by making ExecutionNodeResult a value type and short-circuiting telemetry capture when telemetry collection is disabled.
Changes:
- Convert
ExecutionNodeResultfrom a reference type to areadonly record structto avoid allocations. - Guard activity/timing capture in
ExecutionNode.ExecuteAsyncbehindcontext.CollectTelemetry. - Update
ExecutionState.TryDequeueCompletedResultto return a non-nullableExecutionNodeResult, and add focused execution-state/telemetry unit tests.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/HotChocolate/Fusion/test/Fusion.Execution.Tests/Execution/ExecutionNodeCompletionTests.cs | Adds coverage for telemetry gating, single-completion behavior across outcomes, dependent scheduling, and merge-failure application with struct results. |
| src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Nodes/ExecutionNodeResult.cs | Switches ExecutionNodeResult to a readonly record struct to reduce allocations. |
| src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Nodes/ExecutionNode.cs | Skips Activity.Current and timestamp work when telemetry is disabled. |
| src/HotChocolate/Fusion/src/Fusion.Execution/Execution/ExecutionState.cs | Adjusts dequeue API to match the non-nullable struct result type. |
Comments suppressed due to low confidence (1)
src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Nodes/ExecutionNode.cs:122
- When telemetry collection is disabled,
GetTransportDetailswill always return(null, null)but this still performs an extra method call and redundantCollectTelemetrycheck. Since you already havecollectTelemetryhere, you can avoid the call entirely on the hot path when telemetry is off.
error,
context.GetDependentsToExecute(this),
context.GetSkippedDefinitions(this),
context.GetVariableValueSets(this),
context.GetTransportDetails(this));
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Patch coverage100.0% of changed lines covered (4/4)
Project coverage: 53.4% (227760/426465 lines) |
This was referenced Jul 13, 2026
This was referenced Jul 20, 2026
chore(deps): Bump HotChocolate.Subscriptions.InMemory from 15.1.14 to 16.5.1
Kuestenlogik/Bowire#506
Merged
This was referenced Aug 1, 2026
This was referenced Aug 10, 2026
Open
Open
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.
No description provided.