Repository navigation
Add optional chunked response writes with tryWrite - #1960
Open
GetThatCookie wants to merge 1 commit into
Open
GetThatCookie wants to merge 1 commit into
GetThatCookie wants to merge 1 commit into
Conversation
Write chunk bodies without buffering unaccepted data, preserve body offsets across retries, and support final chunks. Combine corked headers, body and framing in one TCP send when possible. Add a streaming example and backpressure regression coverage, and pin the companion uSockets changes.
| [submodule "uSockets"] | ||
| path = uSockets | ||
| url = https://github.com/uNetworking/uSockets.git | ||
| url = https://github.com/GetThatCookie/uSockets.git |
Contributor
|
Does this rely on uSockets changes? |
This branch has not been deployed
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.

I started over from master with a focused alternative to #1922, following the feedback there.
The goal is proper backpressure for unknown-length responses through
tryWrite(data, finalChunk = false). Unaccepted body data stays with the caller, retries useonWritable, and the TCP path combines corked headers, body and framing in one send.For the ultimate-express 2.2.1 streaming workload with 5 MiB responses in 64 KiB chunks:
writetryWrite+41.3% throughput, measured across five runs with 64 connections on Linux loopback.
In the native backpressure test with 64 stalled TCP clients and shared payload data, additional process RSS dropped from 214 MiB to 20 KiB.
Companion: uSockets/tryWrite.