Repository navigation
HttpResponse: write the status, Date and Content-Length lines in one piece each - #1958
Open
nigrosimone wants to merge 1 commit into
Open
nigrosimone wants to merge 1 commit into
nigrosimone wants to merge 1 commit into
Conversation
nigrosimone
marked this pull request as ready for review
October 7, 2026 18:41
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.
A response head is about ten AsyncSocket::write calls, and each one repeats the closed check, the loop data lookup and the cork checks. This writes the status line, the Content-Length line and the uWebSockets mark in one piece each, and the Date line from a copy LoopData prepares when the date ticks: from ten writes to four for a minimal response.
Bytes are identical (static, JS handler, chunked, status over 64 chars, 404, 70 KB body, WebSocket upgrade, with and without the mark).
User-space instructions per request, two copies of the build each: arm64 (OCI A1, Node 26) -18% on a DeclarativeResponse, -4% on a JS handler with status, two headers and end; x64 (Node 24) -20% and -5%. Requests per second swing ±20% between rounds of the same build on both boxes, so a gain this size does not show there.