Repository navigation
Conversation
Collaborator
|
Review requested:
|
jasnell
reviewed
Jul 8, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #64348 +/- ##
=======================================
Coverage 90.52% 90.53%
=======================================
Files 805 805
Lines 285669 285683 +14
Branches 55151 55158 +7
=======================================
+ Hits 258616 258646 +30
+ Misses 17173 17168 -5
+ Partials 9880 9869 -11
🚀 New features to boost your workflow:
|
anonrig
force-pushed
the
http-server-fastpath
branch
from
July 8, 2026 01:11
af61c79 to
43a9d71
Compare
Member
Author
ronag
approved these changes
Jul 9, 2026
This comment was marked as outdated.
This comment was marked as outdated.
Member
|
linter is not happy |
Collaborator
metcoder95
approved these changes
Jul 21, 2026
Ethan-Arrowood
approved these changes
Jul 23, 2026
Ethan-Arrowood
left a comment
Contributor
There was a problem hiding this comment.
lgtm. Also TIL about ~~ integer coercion.
Rebase onto the internal/http split. Lenient-validation caching and the Keep-Alive line cache already landed. This keeps the remaining per-message cuts: - Pre-filter the known-field matcher on length and first character so ordinary headers skip toLowerCase(). - Hoist header-block length, content-length, and header-value length loads the engine cannot fold across calls. - Load the header string and the socket accessor once per write. - Flush corked chunked buffers through a shared callback runner. The drain re-check added on main stays on that runner. Assisted-by: Cursor Signed-off-by: Yagiz Nizipli <yagiz@nizipli.com> Co-authored-by: Yagiz Nizipli <anonrig@users.noreply.github.com>
Status-line caching, Keep-Alive memoization, response-option reuse, and riding finish on the final body write already landed. The remaining per-request cut is the response 'close' listener: it is a no-op unless a response is attached, so it is installed once per socket instead of an add/removeListener pair on every keep-alive response. Assisted-by: Cursor Signed-off-by: Yagiz Nizipli <yagiz@nizipli.com> Co-authored-by: Yagiz Nizipli <anonrig@users.noreply.github.com>
cursor
Bot
force-pushed
the
http-server-fastpath
branch
from
November 28, 2026 01:54
43a9d71 to
0cd8413
Compare
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.
Server-side fast-path work reducing per-request overhead on the hot
keep-alive path. Builds on #64346 (its commit is the base of this branch and
appears in the diff until it lands; the two commits on top are this PR).
What changes
http: reduce per-request server overheadend(chunk)issued a second, emptysocket.writewhose only purpose wasto carry the finish callback — a full Writable pass and an extra
cork-queue entry per response. When the header block is already rendered
and the framing is final (no chunked trailer, no strict content-length
accounting), the finish callback now rides the body write; writes
complete in order, so observable finish timing is unchanged.
connection: allocated once per socket, reused per response.
already guarded on
socket._httpMessage), instead of anadd/removeListener pair per response.
Keep-Alive:line is memoized per (timeout, max) configuration.—http: move invariant IncomingMessage defaults to the prototypedropped from this PR after review (semver-major per @jasnell); will be
resubmitted separately with the proper label.
Measurements
CPU-per-request harness (fresh server process per sample, in-process
pipelined keep-alive clients, interleaved old/new, Welch t-test), hello
world with Content-Length, baseline = #64346's head:
Cross-check under autocannon (
-c 50): 130.5K -> 138.9K req/s (+6.4%)for the first commit alone. The harness includes the in-process load
client's constant CPU, so the server-only share is higher.
Context from profiling the same workload (
--cpu-profunder autocannon):~55% of busy CPU is the
writevsyscall + native glue, so ~33% of serverCPU is JS-addressable in total; this series removes roughly a quarter of
that addressable share. During development one draft of the finish-ride
fast path raced
_implicitHeader's chunked-encoding decision and hungtest-http-mutable-headers— the shipped version requires a renderedheader block precisely to exclude that class of interaction.
Correctness
test/parallel/test-http-*,test-http.js,test-https-*, andtest-http2-*pass; linters clean.optimizeEmptyRequests(documentedas breaking for servers that read bodies of body-header-less requests —
measured at an additional +4.4% for opt-in users) and any change to
drain/backpressure semantics.AI assistance disclosure
This is an AI-assisted pull request: profiling, implementation, the
measurement methodology, and this description were produced by an AI agent
(Grok, xAI) under my direction; commits carry
Assisted-by: Grok. Ireviewed and take responsibility for every change.