Skip to content

Add three-buffer socket writes for chunked responses - #262

Open
GetThatCookie wants to merge 1 commit into
uNetworking:masterfrom
GetThatCookie:tryWrite
Open

GetThatCookie wants to merge 1 commit into
uNetworking:masterfrom
GetThatCookie:tryWrite

Conversation

@GetThatCookie

Copy link
Copy Markdown

Companion to the smaller tryWrite alternative to uNetworking/uWebSockets#1922.

us_socket_write3 lets the chunked response path send corked headers, body and trailing framing in one TCP syscall. This also fixes partial-write tracking for vectored writes and avoids SIGPIPE on disconnected peers.

For a 64 KiB response, this reduces two sends to one. In the streaming benchmark, the three-buffer implementation achieved 10.1% higher throughput than the two-buffer version.

Track partial vectored writes for writable notifications and avoid SIGPIPE on disconnected peers.
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