Skip to content

Perf: skip redundant upfront per-stream WINDOW_UPDATE in H2#632

Merged
haga-rak merged 1 commit into
mainfrom
perf/h2-drop-upfront-stream-window-update
Apr 16, 2026
Merged

Perf: skip redundant upfront per-stream WINDOW_UPDATE in H2#632
haga-rak merged 1 commit into
mainfrom
perf/h2-drop-upfront-stream-window-update

Conversation

@haga-rak
Copy link
Copy Markdown
Owner

Summary

StreamWorker.ProcessResponse emitted a WINDOW_UPDATE(streamId, Local.WindowSize) right after HEADERS on every new stream. Since SETTINGS_INITIAL_WINDOW_SIZE (6 MB) is already advertised in the connection preface, each new stream already has that full credit. The extra frame was wasted: one channel enqueue and 13 wire bytes per request, with no benefit for any body within the initial window.

Large-body streaming still gets credit via the consumption-driven path in OnDataConsumedByCaller (per-stream update above 16 KiB consumed, plus connection-level updates through ShouldWindowUpdate).

No impact on the Akamai / JA4 H2 fingerprint: those capture the connection-level WINDOW_UPDATE on stream 0 from the preface (SettingHelper.WriteWelcomeSettings), which is unchanged.

Refreshed ProxyThroughputBenchmark numbers in the README.

SETTINGS_INITIAL_WINDOW_SIZE (Local.WindowSize) is already advertised
in the connection preface, so every new stream starts with that full
credit. Emitting another WINDOW_UPDATE of the same size right after
HEADERS was wasted work: one extra channel enqueue and 13 wire bytes
per request, with no benefit for any body within the initial window.
Consumption-driven updates in OnDataConsumedByCaller still cover
streaming of large bodies.

Refresh ProxyThroughputBenchmark numbers in README.
@haga-rak haga-rak merged commit ce62436 into main Apr 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant