Skip to content

perf: batch inbound WINDOW_UPDATE frames - #271

Open
anmonteiro wants to merge 1 commit into
perf/data-frame-payload-viewfrom
perf/batch-window-updates
Open

perf: batch inbound WINDOW_UPDATE frames#271
anmonteiro wants to merge 1 commit into
perf/data-frame-payload-viewfrom
perf/batch-window-updates

Conversation

@anmonteiro

Copy link
Copy Markdown
Owner

Summary

  • batch inbound WINDOW_UPDATE credit instead of emitting one frame per body read callback
  • keep connection-level credit pending across streams and batch per-stream credit within each active body
  • update flow-control tests to cover both delayed small reads and threshold-crossing batched updates

Why

On large uploads, h2 was returning flow-control credit on every consumed chunk at both the connection and stream levels. Under the 1.5 GiB curl upload benchmark, that creates heavy write-loop churn and a large number of control frames.

Validation

  • dune build --display=short @runtest-test_h2 @runtest-test_h2_client @runtest-test_h2_server spec/eio_h2spec.exe
  • all tests passed

Benchmark

Using the existing 1.5 GiB curl upload benchmark against the Eio server, with the same local gluten checkout in both variants:

  • baseline (cb71ce5): 4.168s, 368.52 MiB/s; 4.156s, 369.57 MiB/s
  • batched WINDOW_UPDATEs: 3.231s, 475.41 MiB/s; 3.175s, 483.73 MiB/s

This is about a 29-31% throughput improvement on this workload.

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