Skip to content

Avoid redundant source row decodes in Fusion value completion - #10132

Merged
michaelstaib merged 5 commits into
mainfrom
mst/fusion-value-completion-row-reuse
Jul 21, 2026
Merged

michaelstaib merged 5 commits into
mainfrom
mst/fusion-value-completion-row-reuse

Conversation

@michaelstaib

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings July 21, 2026 20:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 Fusion execution result value completion by introducing a stack-only “snapshot” of SourceResultElement that carries the already-decoded metadata row (DbRow), reducing redundant row lookups during completion and leaf assignment. It also adds regression coverage around enum masking behavior.

Changes:

  • Added SourceResultElementSnapshot to cache decoded DbRow metadata for a SourceResultElement.
  • Updated ValueCompletion and composite result assignment paths to use snapshots for scalar/enum handling and leaf writes.
  • Extended SourceResultDocument APIs to accept DbRow directly and added tests for enum masking in edge cases.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/HotChocolate/Fusion/test/Fusion.Execution.Tests/Execution/Results/FetchResultStoreTests.cs Adds tests ensuring enum values are masked when unknown or when encoded with JSON escape sequences.
src/HotChocolate/Fusion/src/Fusion.Execution/Text/Json/SourceResultElementSnapshot.cs Introduces a ref-struct snapshot type carrying _row to avoid repeated row decoding.
src/HotChocolate/Fusion/src/Fusion.Execution/Text/Json/SourceResultElement.cs Adds CreateSnapshot() factory to produce snapshots from elements.
src/HotChocolate/Fusion/src/Fusion.Execution/Text/Json/SourceResultDocument.Text.cs Adds DbRow-based overloads for string/raw-value accessors used by snapshots.
src/HotChocolate/Fusion/src/Fusion.Execution/Text/Json/SourceResultDocument.cs Adds DbRow-based overloads for array/object metadata queries.
src/HotChocolate/Fusion/src/Fusion.Execution/Text/Json/CompositeResultElement.cs Updates leaf assignment to accept a snapshot instead of (element,row) pairs.
src/HotChocolate/Fusion/src/Fusion.Execution/Text/Json/CompositeResultDocument.cs Refactors source assignment to accept (SourceResultDocument, Cursor, DbRow) to leverage snapshots.
src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Results/ValueCompletion.cs Switches completion logic to create and pass snapshots, reducing repeated DbRow fetches.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/HotChocolate/Fusion/src/Fusion.Execution/Text/Json/SourceResultElement.cs Outdated
@michaelstaib
michaelstaib merged commit e28061c into main Jul 21, 2026
7 of 8 checks passed
@michaelstaib
michaelstaib deleted the mst/fusion-value-completion-row-reuse branch July 21, 2026 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants