Skip to content

Coalesce outbound writes into a single buffer before a flush - #9

Merged
glbrntt merged 1 commit into
apple:mainfrom
glbrntt:coalesce-outbound-buffers
Jul 8, 2026
Merged

Coalesce outbound writes into a single buffer before a flush#9
glbrntt merged 1 commit into
apple:mainfrom
glbrntt:coalesce-outbound-buffers

Conversation

@glbrntt

@glbrntt glbrntt commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Motivation:

The HTTP3 stream handler emits a ByteBuffer for each write it does. This creates more ByteBuffer's and more pipeline traversals than is necessary.

Modifications:

  • Store the pending buffer in the stream handler and append to it for each write. Coalesce write promises as well.
  • Only emit the buffer when a flush happens.

Result:

Fewer allocations, fewer pipeline traversals.

@glbrntt glbrntt added the 🔨 semver/patch No public API change. label Jul 8, 2026
Motivation:

The HTTP3 stream handler emits a ByteBuffer for each write it does. This
creates more ByteBuffer's and more pipeline traversals than is
necessary.

Modifications:

- Store the pending buffer in the stream handler and append to it for
  each write. Coalesce write promises as well.
- Only emit the buffer when a flush happens.

Result:

Fewer allocations, fewer pipeline traversals.
@glbrntt
glbrntt force-pushed the coalesce-outbound-buffers branch from 543fea5 to 67bd711 Compare July 8, 2026 10:14
@glbrntt
glbrntt requested a review from josephnoir July 8, 2026 10:16
@glbrntt
glbrntt merged commit a646c53 into apple:main Jul 8, 2026
29 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 semver/patch No public API change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants