Repository navigation
[Fusion] Let NativeAOT inline the value completion fast paths - #10891
Merged
Merged
Conversation
NativeAOT compiles without profile data and keeps small helpers out of line when their IL is just over its inlining budget. Split the value completion helpers into a small fast path and a non-inlined slow path (cursor moves across chunks, raw object contexts, raw object property lookup, selection set resolution, raw values that span data chunks) and mark the fast paths and the tiny accessors they use for inlining. Small selection sets are searched with a compact loop instead of an unrolled switch, so the lookup stays small at every inlined call site.
Contributor
Patch coverage79.4% of changed lines covered (54/68)
Uncovered changed lines (JSON){
"sha": "d64ef72c8c393782728d5a69e1e6383bf85e5871",
"files": [
{ "path": "src/HotChocolate/Fusion/src/Fusion.Execution/Text/Json/CompositeObjectContext.cs", "ranges": [[61, 61], [69, 69], [71, 75]] },
{ "path": "src/HotChocolate/Fusion/src/Fusion.Execution/Text/Json/CompositeResultDocument.Cursor.cs", "ranges": [[214, 215]] },
{ "path": "src/HotChocolate/Fusion/src/Fusion.Execution/Text/Json/SourceResultDocument.Cursor.cs", "ranges": [[185, 186]] },
{ "path": "src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Nodes/Selection.cs", "ranges": [[298, 298]] },
{ "path": "src/HotChocolate/Fusion/src/Fusion.Execution/Text/Json/CompositeResultDocument.TryGetProperty.cs", "ranges": [[416, 417]] }
]
}Project coverage: 59.8% (326986/546561 lines) |
This was referenced Nov 17, 2026
chore(deps): Bump HotChocolate.Subscriptions.InMemory from 16.7.5 to 16.7.7
Kuestenlogik/Bowire#1032
Merged
This was referenced Nov 23, 2026
fix(deps): Bump Basic.Reference.Assemblies.Net100 and 43 others
AdCodicem/AdCodicem.ValueObjects#274
Closed
This was referenced Nov 30, 2026
Merged
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.
Value completion's hot helpers were just over the size where NativeAOT, which has no PGO, inlines them, so every completed property and list element paid several calls. This splits them into small inline fast paths with
NoInliningcold paths for chunk-crossing cursor moves and raw reads, raw object contexts, selection set resolution and enum completion. The cursor's cold path is static, so inlined cursor arithmetic keeps cursor locals in registers. Responses are byte-identical (same sha256) and allocations are unchanged. With a static PGO profile for the AOT build the gain shrinks to +0.3% req/s (CPU per request 0.758 to 0.747 ms).Measured with k6 on the benchmark twin (16.7.0 subgraphs, socket and Kestrel inline settings on,
OptimizationPreferencedefault), base and change interleaved ABBA, medians of 4 rounds (2 for constant-latency JIT and static PGO).