Skip to content

Flatten Fusion result selection set child lookups - #10142

Merged
michaelstaib merged 2 commits into
mainfrom
mst/fusion-result-selection-set-flatten
Jul 23, 2026
Merged

michaelstaib merged 2 commits into
mainfrom
mst/fusion-result-selection-set-flatten

Conversation

@michaelstaib

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings July 23, 2026 08:19

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 simplifies Fusion’s ResultSelectionSet child-lookup implementation by removing the small/large subclass split and consolidating lookup strategy (linear scan vs dictionary) into a single sealed type, reducing virtual dispatch overhead while preserving the existing size threshold behavior.

Changes:

  • Consolidated SmallResultSelectionSet and LargeResultSelectionSet behavior into a single sealed ResultSelectionSet with an optional dictionary-backed child lookup.
  • Removed the two specialized selection set classes.
  • Updated the benchmark to assert lookup strategy via a new UsesDictionaryLookup indicator instead of concrete subclass types.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Nodes/SmallResultSelectionSet.cs Removed; behavior is now handled inside ResultSelectionSet.
src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Nodes/LargeResultSelectionSet.cs Removed; behavior is now handled inside ResultSelectionSet.
src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Nodes/ResultSelectionSet.cs Flattened child lookup logic into one sealed class with an optional dictionary for larger selection sets.
src/HotChocolate/Fusion/benchmarks/Fusion.Execution.Benchmarks/ResultSelectionSetLookupBenchmark.cs Updated benchmark assertions to validate lookup strategy rather than relying on concrete types.

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

@github-actions

github-actions Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Patch coverage

92.6% of changed lines covered (88/95)

File Covered Changed Patch %
…/src/Fusion.Execution/Execution/Nodes/ResultSelectionSet.cs 88 95 92.6% 🟡
Uncovered changed lines (JSON)
{
  "sha": "38db82d9a8e6edbeced39b7271905e0ca38daa29",
  "files": [
    { "path": "src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Nodes/ResultSelectionSet.cs", "ranges": [[76, 76], [100, 102], [116, 116], [154, 155]] }
  ]
}

Project coverage: 53.8% (231723/430578 lines)

@michaelstaib
michaelstaib merged commit c67ddc0 into main Jul 23, 2026
6 of 7 checks passed
@michaelstaib
michaelstaib deleted the mst/fusion-result-selection-set-flatten branch July 23, 2026 11:04
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