stream: cut per-chunk overhead in WHATWG streams#64252
Open
mcollina wants to merge 1 commit into
Open
Conversation
Consolidate the spec's per-chunk predicate chains (CanCloseOrEnqueue, IsLocked, HasDefaultReader, GetNumReadRequests, GetDesiredSize and the writable-side equivalents) into single passes over the controller and stream state, mirror "close queued or in flight" as a boolean flag maintained at the few close-request transition sites, and materialize the TransformStream [[backpressureChangePromise]] record lazily on first observation so backpressure flips nobody is waiting on allocate nothing. Assisted-by: Claude Code Signed-off-by: Matteo Collina <hello@matteocollina.com>
ef778b5 to
ddba21e
Compare
Contributor
|
Benchmark CI: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1879/ Results |
aduh95
approved these changes
Jul 2, 2026
Collaborator
Collaborator
This comment was marked as duplicate.
This comment was marked as duplicate.
anonrig
approved these changes
Jul 2, 2026
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.
Consolidates the spec's per-chunk predicate chains into single passes over the controller/stream state, mirrors "close queued or in flight" as a boolean flag, and materializes the TransformStream
[[backpressureChangePromise]]record lazily on first observation.Benchmark results (
benchmark/compare.js --runs 10vs main, same-day build):No regressions on the remaining rows (n.s.). WPT streams/compression/encoding and all parallel whatwg/webstream tests pass unchanged.