Skip to content

Hoist source path segment transcoding out of Fusion batch merges - #10153

Merged
michaelstaib merged 2 commits into
mainfrom
mst/fusion-getdataelement-transcode-hoist
Jul 27, 2026
Merged

Hoist source path segment transcoding out of Fusion batch merges#10153
michaelstaib merged 2 commits into
mainfrom
mst/fusion-getdataelement-transcode-hoist

Conversation

@michaelstaib

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings July 27, 2026 15:49

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’s batch result merging by hoisting source-path field-name transcoding out of the per-result merge loop, so the source path is encoded once and reused across all results in a batch.

Changes:

  • Precompute UTF-8 encoded field-segment names (and segment end offsets) once per AddPartialResults* call and reuse them when extracting data elements.
  • Add a GetDataElement overload that consumes the pre-encoded segment names to avoid repeated per-result transcoding.
  • Add a regression test that covers merging when the source path contains multiple field segments (with/without errors).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Results/FetchResultStore.cs Hoists path transcoding for batch merges and adds a span-based GetDataElement overload plus helpers.
src/HotChocolate/Fusion/test/Fusion.Execution.Tests/Execution/Results/FetchResultStoreTests.cs Adds test coverage for multi-segment sourcePath batch merging.

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

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@michaelstaib
michaelstaib merged commit 86dfadf into main Jul 27, 2026
6 of 7 checks passed
@michaelstaib
michaelstaib deleted the mst/fusion-getdataelement-transcode-hoist branch July 27, 2026 15:56
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