Skip to content

[Fusion] Call alias-batched subgraphs without nested async iterators - #10940

Merged
michaelstaib merged 3 commits into
mainfrom
perf/alias-batch-buffered
Nov 13, 2026
Merged

michaelstaib merged 3 commits into
mainfrom
perf/alias-batch-buffered

Conversation

@michaelstaib

Copy link
Copy Markdown
Member

#10707 moved subgraph calls onto a buffered path, but alias-batched requests stayed on the old streaming path with two nested async iterators and three new arrays per call. Alias-batched variable sets and operation batches now take the buffered path too, and their per-call arrays come from the shared array pool. On the benchmark this covers the reviews batch, which is on the critical path, and the inventory lookup. Each request allocates about 15% less, and responses are byte-identical. Batches with fewer than two items, or with a request that cannot join the batch, keep the streaming path.

Metric Before Optimization After Optimization
Constant-latency req/s, AOT 3,330 3,357 (+0.8%)
Constant-latency p50 / p95 ms, AOT 13.99 / 19.43 13.85 / 19.27
Constant-latency req/s, JIT 3,415 3,406 (-0.3%)
Constant-latency p50 / p95 ms, JIT 13.63 / 18.94 13.65 / 19.09
Constant req/s, AOT 4,759 4,810 (+1.1%)
Constant req/s, JIT 5,024 5,047 (+0.5%)
CPU ms/req, constant-latency, AOT 0.795 0.782 (-1.7%)
CPU ms/req, constant, AOT 0.775 0.761 (-1.8%)
Allocated KiB/req, constant-latency, JIT 25.7 21.7 (-15.6%)
Allocated KiB/req, constant, JIT 25.3 21.4 (-15.5%)
Steady-state RSS avg MB, constant-latency, AOT 100.3 95.4
Steady-state RSS avg MB, constant, AOT 95.5 97.9
GC heap after gen1 GC MB, constant-latency / constant, AOT 34.5 / 37.7 34.2 / 38.0
Gen1 GCs per 3-minute run, constant-latency / constant, AOT 343 / 414 242 / 241
Idle RSS MB, AOT 50.1 50.2
Startup ms, AOT 76 76

Measured on the benchmark twin with the official 16.7.0 subgraphs and the official gateway settings, before is a280f13: req/s, CPU and allocations are means of 2-5 interleaved rounds (40 s warm-up, 45 s measured), and the RSS and GC rows are the last 120 s of 3-minute runs, 2 per mode, because a 45 s window can catch the one-time drop after warm-up, which comes later when fewer gen1 GCs run.

Copilot AI balanced review requested due to automatic review settings November 13, 2026 08:14

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@github-actions

Copy link
Copy Markdown
Contributor

Patch coverage

94.3% of changed lines covered (181/192)

File Covered Changed Patch %
…/Execution/Clients/HttpSourceSchemaClient.AliasBatching.cs 135 146 92.5% 🟡
…/Clients/AliasBatching/AliasBatchResponseSplitter.cs 27 27 100.0% 🟢
…/Execution/Clients/HttpSourceSchemaClient.Buffered.cs 17 17 100.0% 🟢
…/Execution/Nodes/OperationBatchExecutionNode.cs 1 1 100.0% 🟢
…/Fusion.Execution/Execution/Nodes/OperationExecutionNode.cs 1 1 100.0% 🟢
Uncovered changed lines (JSON)
{
  "sha": "fd15bc3a11d49848962bd764214f3625a797b037",
  "files": [
    { "path": "src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Clients/HttpSourceSchemaClient.AliasBatching.cs", "ranges": [[113, 116], [168, 171], [272, 273], [458, 458]] }
  ]
}

Project coverage: 59.8% (327299/546882 lines)

@michaelstaib
michaelstaib merged commit 0b86e64 into main Nov 13, 2026
159 checks passed
@michaelstaib
michaelstaib deleted the perf/alias-batch-buffered branch November 13, 2026 22:03
This was referenced Nov 17, 2026
This was referenced Nov 23, 2026
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