Perf: skip redundant upfront per-stream WINDOW_UPDATE in H2#632
Merged
Conversation
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.
This was referenced Apr 20, 2026
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.
Summary
StreamWorker.ProcessResponseemitted aWINDOW_UPDATE(streamId, Local.WindowSize)right after HEADERS on every new stream. SinceSETTINGS_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 throughShouldWindowUpdate).No impact on the Akamai / JA4 H2 fingerprint: those capture the connection-level
WINDOW_UPDATEon stream 0 from the preface (SettingHelper.WriteWelcomeSettings), which is unchanged.Refreshed
ProxyThroughputBenchmarknumbers in the README.