Repository navigation
[Fusion] Reuse the value completion of a pooled result store - #10616
Closed
tobias-tengler wants to merge 3 commits into
Closed
tobias-tengler wants to merge 3 commits into
tobias-tengler wants to merge 3 commits into
Conversation
When one lookup result is merged into a primary target and several additional targets, the primary target is completed from the source data and, when every completed value is a non-null, non-enum leaf of an object with the same selection set, the completed rows are copied into each additional target instead of completing the same source data again. Targets that do not qualify, merges with errors and pocketed errors keep the existing completion.
Additional targets of a lookup variable set are kept as cursors into the result document instead of building a path per target. The merge uses the cursors directly while no value that references an object or a list was replaced since the targets were collected, and resolves the target from the root by its path otherwise. The paths of a CompactPathSegment are created on first access, so error attribution, telemetry and custom clients keep working.
Contributor
Patch coverage92.7% of changed lines covered (293/316)
Uncovered changed lines (JSON){
"sha": "468a282cf1f87fddbb8957d07efb1250077caa4a",
"files": [
{ "path": "src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Results/FetchResultStore.cs", "ranges": [[729, 731], [733, 733], [751, 752], [759, 760], [773, 773], [789, 790], [805, 806], [835, 836], [845, 846], [888, 889], [924, 925]] },
{ "path": "src/HotChocolate/Fusion/src/Fusion.Execution/Text/Json/CompactPathSegment.cs", "ranges": [[85, 85], [90, 90]] }
]
}Project coverage: 59.0% (311709/528004 lines) |
tobias-tengler
changed the base branch from
main
to
tte/fusion-duplicate-lookup-target-cursors
October 19, 2026 06:44
Base automatically changed from
tte/fusion-duplicate-lookup-target-cursors
to
main
October 21, 2026 05:51
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.
A pooled
FetchResultStorecreates a newValueCompletionevery time it is initialized for a request, even though the schema, error handler and error handling mode it is created with are usually the same as for the previous request.This PR keeps the
ValueCompletionof a pooled store across requests and creates a new one only when the schema, error handler or error handling mode differ.One store lifecycle of a request (initialize and clean). The store allocates 74 B less per request, with time unchanged within the error interval. A small, reliable allocation win on a per-request path.