René's URL Explorer Experiment


Title: stream: speed up WHATWG web streams by anonrig · Pull Request #65273 · nodejs/node · GitHub

Open Graph Title: stream: speed up WHATWG web streams by anonrig · Pull Request #65273 · nodejs/node

X Title: stream: speed up WHATWG web streams by anonrig · Pull Request #65273 · nodejs/node

Description: Leftover construction-path work on node:stream/web after #65138 landed the shared hot-path reductions (thenAlgorithmResult, kResolvedPromise, raw pull/write callbacks, parkOnReady). Rebased onto current main, including #65143 (transform backpressure decoupling). That PR's raw defaultTransformAlgorithm / createRawCallback2Params path is kept. The earlier body described work that is no longer in this tree (pipeTo sync-fill, write-queue drain, native webstreams binding, shared kResolvedPromise on public slots). This is what remains. What remains Deferred empty ReadableStream controller. new ReadableStream() with no source/strategy skips validateObject and does not allocate a default controller until getReader(), cancel() (only while readable), pipeTo(), tee(), or values(). createReadableStreamState() initializes controller: undefined so empty and non-empty streams share the same hidden class. Interop error() on an empty stream marks it errored without materializing a controller. Subclasses that call those methods after super() still get a controller before the subclass constructor finishes; passing a source leaves this path and creates the controller during super() as usual. Cheaper empty WritableStream / TransformStream construction. Skip validateObject on the shared empty sentinels. The writable AbortController is created lazily and materialized on abort() or first controller.signal access, so a signal observed after abort is still aborted with that reason. isNonThenable() stays in JS. Shared helper for start/pull/write results. null / primitives take the allocation-free kResolvedPromise reaction; objects and functions stay on the maybe-thenable path (no observable .then lookup). There is no native webstreams binding. Review follow-up (removed) Addressed #65273 (comment): readableStreamDefaultControllerFillSync is gone (one pull per microtask) pipeTo write-queue drain loop is gone (one write completion per microtask) writer.ready / writer.closed / cancel() mint distinct promises (no shared kResolvedPromise) cancel/close/abort/flush/transform keep async wrappers so thenable results keep the previous microtask count native internalBinding('webstreams') removed; cloneAsUint8Array is still the JS ArrayBuffer.prototype.slice path (detached buffers stay TypeError) Semver The earlier semver-major concerns were the removed fillSync / drain / shared-promise / timing-helper changes. Public constructors, methods, and WHATWG Streams behavior (backpressure, BYOB, pipeTo, tee, errors, transfer) are intended to be unchanged. @MattiasBuelens noted the remaining scope does not look semver-major. Benchmarks The numbers previously posted here were measured against a base that predates #65138 and included the removed optimizations. They are not this PR's remaining delta. A full webstreams/ compare against current main still needs to be posted. Tests test/wpt/test-streams.js test/parallel/test-whatwg-readable*, writable*, transform*, webstreams*, test-webstreams*, test-global-webstreams.js new test/parallel/test-whatwg-webstreams-hotpath.js (public read() / pipeTo, deferred controller / subclass constructors, isNonThenable / Proxy, cloneAsUint8Array edge cases, abort-before-signal, distinct writer.ready / writer.closed / cancel() promises) abort-before-signal case in test-whatwg-writablestream.js AI assistance This change was developed with assistance from Grok. I reviewed, tested, and take responsibility for the submitted code.

Open Graph Description: Leftover construction-path work on node:stream/web after #65138 landed the shared hot-path reductions (thenAlgorithmResult, kResolvedPromise, raw pull/write callbacks, parkOnReady). Rebased onto cu...

X Description: Leftover construction-path work on node:stream/web after #65138 landed the shared hot-path reductions (thenAlgorithmResult, kResolvedPromise, raw pull/write callbacks, parkOnReady). Rebased onto cu...

Opengraph URL: https://github.com/nodejs/node/pull/65273

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:90e125b9-2234-cb72-6bfa-abddc728f2a7
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idCD2C:278FD:5285E3:6B5205:6AED2793
html-safe-nonce22b3b28bd907bc6973670d619f0999e31050b2e6d8c6df4613e4f9eead34e2eb
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRDJDOjI3OEZEOjUyODVFMzo2QjUyMDU6NkFFRDI3OTMiLCJ2aXNpdG9yX2lkIjoiODkyNTY5NzA3NjY1NzcyNzM3OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac20a14f4d70935535cd293458be4b5cc6f12f96eb19b26fdd8e94550991a35ade
hovercard-subject-tagpull_request:4275632506
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/nodejs/node/pull/65273/files
twitter:imagehttps://avatars.githubusercontent.com/u/1935246?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1935246?s=400&v=4
og:image:altLeftover construction-path work on node:stream/web after #65138 landed the shared hot-path reductions (thenAlgorithmResult, kResolvedPromise, raw pull/write callbacks, parkOnReady). Rebased onto cu...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None9d95365dda0576efe9b71f45807595e396bd0ca9286fba5367a05048e6ddf8f2
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/nodejs/node git https://github.com/nodejs/node.git
octolytics-dimension-user_id9950313
octolytics-dimension-user_loginnodejs
octolytics-dimension-repository_id27193779
octolytics-dimension-repository_nwonodejs/node
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id27193779
octolytics-dimension-repository_network_root_nwonodejs/node
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release98b41fa4b5635ceb45a4c54320fced73817ff290
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/nodejs/node/pull/65273/changes#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fpull%2F65273%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fpull%2F65273%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=nodejs%2Fnode
Reloadhttps://github.com/nodejs/node/pull/65273/changes
Reloadhttps://github.com/nodejs/node/pull/65273/changes
Reloadhttps://github.com/nodejs/node/pull/65273/changes
nodejshttps://github.com/nodejs
nodehttps://github.com/nodejs/node
Codehttps://github.com/nodejs/node
Issues657 (657)https://github.com/nodejs/node/issues
Pull requests666 (666)https://github.com/nodejs/node/pulls
Actionshttps://github.com/nodejs/node/actions
Projectshttps://github.com/nodejs/node/projects
Security and qualityhttps://github.com/nodejs/node/security
Insightshttps://github.com/nodejs/node/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fnodejs%2Fnode%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fnodejs%2Fnode%2Fissues%2Fnew%2Fchoose
anonrighttps://github.com/anonrig
nodejs:mainhttps://github.com/nodejs/node/tree/main
anonrig:stream-speed-up-webstreamshttps://github.com/anonrig/node/tree/stream-speed-up-webstreams
Conversation 44 https://github.com/nodejs/node/pull/65273
Commits 2 https://github.com/nodejs/node/pull/65273/commits
Checks 30 https://github.com/nodejs/node/pull/65273/checks
Files changed https://github.com/nodejs/node/pull/65273/files
Please reload this pagehttps://github.com/nodejs/node/pull/65273/changes
stream: speed up WHATWG web streams https://github.com/nodejs/node/pull/65273/changes#top
Show all changes 2 commits https://github.com/nodejs/node/pull/65273/files
7f0def5 stream: speed up WHATWG web streams anonrig Aug 17, 2026 https://github.com/nodejs/node/pull/65273/commits/7f0def52b8510bae7b575c39e98ff6a31bd3c99c
83a8457 stream: address webstreams review blockers anonrig Aug 18, 2026 https://github.com/nodejs/node/pull/65273/commits/83a845780392dfa2299dabf5646850fe8d8884ee
Clear filters https://github.com/nodejs/node/pull/65273/files
Please reload this pagehttps://github.com/nodejs/node/pull/65273/changes
Please reload this pagehttps://github.com/nodejs/node/pull/65273/changes
readablestream.js https://github.com/nodejs/node/pull/65273/changes#diff-a75b6b92eada0f88527acce4428a28471b39067fd0ddaab2fcf26cc022bded47
transformstream.js https://github.com/nodejs/node/pull/65273/changes#diff-45cad4ef90ad1549d1ed2ed3f3b7bc9782fece8a0daf45f04e4ec93241693c38
util.js https://github.com/nodejs/node/pull/65273/changes#diff-aaaca5a0d724d6d820d62d474521e10fb5c7d5714401cf3ac799040a30b5ede9
writablestream.js https://github.com/nodejs/node/pull/65273/changes#diff-2495cd91c53a338612a351c4f9e08fdb506d0843f377e20a02641fbb2ac15c78
test-whatwg-webstreams-hotpath.js https://github.com/nodejs/node/pull/65273/changes#diff-2325fd931f7dbd69b75e5b6fcea211e8fa100749d73ffbd0d550da1bec262cbf
test-whatwg-writablestream.js https://github.com/nodejs/node/pull/65273/changes#diff-e1f2c93101bd7835391c8b58e9041046747ddb005f781f270c95f4f12cdb12e4
lib/internal/webstreams/readablestream.jshttps://github.com/nodejs/node/pull/65273/changes#diff-a75b6b92eada0f88527acce4428a28471b39067fd0ddaab2fcf26cc022bded47
View file https://github.com/nodejs/node/blob/83a845780392dfa2299dabf5646850fe8d8884ee/lib/internal/webstreams/readablestream.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/nodejs/node/pull/65273/{{ revealButtonHref }}
https://github.com/nodejs/node/pull/65273/changes#diff-a75b6b92eada0f88527acce4428a28471b39067fd0ddaab2fcf26cc022bded47
https://github.com/nodejs/node/pull/65273/changes#diff-a75b6b92eada0f88527acce4428a28471b39067fd0ddaab2fcf26cc022bded47
https://github.com/nodejs/node/pull/65273/changes#diff-a75b6b92eada0f88527acce4428a28471b39067fd0ddaab2fcf26cc022bded47
https://github.com/nodejs/node/pull/65273/changes#diff-a75b6b92eada0f88527acce4428a28471b39067fd0ddaab2fcf26cc022bded47
https://github.com/nodejs/node/pull/65273/changes#diff-a75b6b92eada0f88527acce4428a28471b39067fd0ddaab2fcf26cc022bded47
https://github.com/nodejs/node/pull/65273/changes#diff-a75b6b92eada0f88527acce4428a28471b39067fd0ddaab2fcf26cc022bded47
https://github.com/nodejs/node/pull/65273/changes#diff-a75b6b92eada0f88527acce4428a28471b39067fd0ddaab2fcf26cc022bded47
https://github.com/nodejs/node/pull/65273/changes#diff-a75b6b92eada0f88527acce4428a28471b39067fd0ddaab2fcf26cc022bded47
https://github.com/nodejs/node/pull/65273/changes#diff-a75b6b92eada0f88527acce4428a28471b39067fd0ddaab2fcf26cc022bded47
https://github.com/nodejs/node/pull/65273/changes#diff-a75b6b92eada0f88527acce4428a28471b39067fd0ddaab2fcf26cc022bded47
https://github.com/nodejs/node/pull/65273/changes#diff-a75b6b92eada0f88527acce4428a28471b39067fd0ddaab2fcf26cc022bded47
https://github.com/nodejs/node/pull/65273/changes#diff-a75b6b92eada0f88527acce4428a28471b39067fd0ddaab2fcf26cc022bded47
https://github.com/nodejs/node/pull/65273/changes#diff-a75b6b92eada0f88527acce4428a28471b39067fd0ddaab2fcf26cc022bded47
https://github.com/nodejs/node/pull/65273/changes#diff-a75b6b92eada0f88527acce4428a28471b39067fd0ddaab2fcf26cc022bded47
https://github.com/nodejs/node/pull/65273/changes#diff-a75b6b92eada0f88527acce4428a28471b39067fd0ddaab2fcf26cc022bded47
https://github.com/nodejs/node/pull/65273/changes#diff-a75b6b92eada0f88527acce4428a28471b39067fd0ddaab2fcf26cc022bded47
https://github.com/nodejs/node/pull/65273/changes#diff-a75b6b92eada0f88527acce4428a28471b39067fd0ddaab2fcf26cc022bded47
https://github.com/nodejs/node/pull/65273/changes#diff-a75b6b92eada0f88527acce4428a28471b39067fd0ddaab2fcf26cc022bded47
https://github.com/nodejs/node/pull/65273/changes#diff-a75b6b92eada0f88527acce4428a28471b39067fd0ddaab2fcf26cc022bded47
https://github.com/nodejs/node/pull/65273/changes#diff-a75b6b92eada0f88527acce4428a28471b39067fd0ddaab2fcf26cc022bded47
lib/internal/webstreams/transformstream.jshttps://github.com/nodejs/node/pull/65273/changes#diff-45cad4ef90ad1549d1ed2ed3f3b7bc9782fece8a0daf45f04e4ec93241693c38
View file https://github.com/nodejs/node/blob/83a845780392dfa2299dabf5646850fe8d8884ee/lib/internal/webstreams/transformstream.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/nodejs/node/pull/65273/{{ revealButtonHref }}
https://github.com/nodejs/node/pull/65273/changes#diff-45cad4ef90ad1549d1ed2ed3f3b7bc9782fece8a0daf45f04e4ec93241693c38
https://github.com/nodejs/node/pull/65273/changes#diff-45cad4ef90ad1549d1ed2ed3f3b7bc9782fece8a0daf45f04e4ec93241693c38
lib/internal/webstreams/util.jshttps://github.com/nodejs/node/pull/65273/changes#diff-aaaca5a0d724d6d820d62d474521e10fb5c7d5714401cf3ac799040a30b5ede9
View file https://github.com/nodejs/node/blob/83a845780392dfa2299dabf5646850fe8d8884ee/lib/internal/webstreams/util.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/nodejs/node/pull/65273/{{ revealButtonHref }}
https://github.com/nodejs/node/pull/65273/changes#diff-aaaca5a0d724d6d820d62d474521e10fb5c7d5714401cf3ac799040a30b5ede9
https://github.com/nodejs/node/pull/65273/changes#diff-aaaca5a0d724d6d820d62d474521e10fb5c7d5714401cf3ac799040a30b5ede9
https://github.com/nodejs/node/pull/65273/changes#diff-aaaca5a0d724d6d820d62d474521e10fb5c7d5714401cf3ac799040a30b5ede9
https://github.com/nodejs/node/pull/65273/changes#diff-aaaca5a0d724d6d820d62d474521e10fb5c7d5714401cf3ac799040a30b5ede9
https://github.com/nodejs/node/pull/65273/changes#diff-aaaca5a0d724d6d820d62d474521e10fb5c7d5714401cf3ac799040a30b5ede9
https://github.com/nodejs/node/pull/65273/changes#diff-aaaca5a0d724d6d820d62d474521e10fb5c7d5714401cf3ac799040a30b5ede9
https://github.com/nodejs/node/pull/65273/changes#diff-aaaca5a0d724d6d820d62d474521e10fb5c7d5714401cf3ac799040a30b5ede9
https://github.com/nodejs/node/pull/65273/changes#diff-aaaca5a0d724d6d820d62d474521e10fb5c7d5714401cf3ac799040a30b5ede9
https://github.com/nodejs/node/pull/65273/changes#diff-aaaca5a0d724d6d820d62d474521e10fb5c7d5714401cf3ac799040a30b5ede9
https://github.com/nodejs/node/pull/65273/changes#diff-aaaca5a0d724d6d820d62d474521e10fb5c7d5714401cf3ac799040a30b5ede9
lib/internal/webstreams/writablestream.jshttps://github.com/nodejs/node/pull/65273/changes#diff-2495cd91c53a338612a351c4f9e08fdb506d0843f377e20a02641fbb2ac15c78
View file https://github.com/nodejs/node/blob/83a845780392dfa2299dabf5646850fe8d8884ee/lib/internal/webstreams/writablestream.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/nodejs/node/pull/65273/{{ revealButtonHref }}
https://github.com/nodejs/node/pull/65273/changes#diff-2495cd91c53a338612a351c4f9e08fdb506d0843f377e20a02641fbb2ac15c78
https://github.com/nodejs/node/pull/65273/changes#diff-2495cd91c53a338612a351c4f9e08fdb506d0843f377e20a02641fbb2ac15c78
https://github.com/nodejs/node/pull/65273/changes#diff-2495cd91c53a338612a351c4f9e08fdb506d0843f377e20a02641fbb2ac15c78
https://github.com/nodejs/node/pull/65273/changes#diff-2495cd91c53a338612a351c4f9e08fdb506d0843f377e20a02641fbb2ac15c78
https://github.com/nodejs/node/pull/65273/changes#diff-2495cd91c53a338612a351c4f9e08fdb506d0843f377e20a02641fbb2ac15c78
https://github.com/nodejs/node/pull/65273/changes#diff-2495cd91c53a338612a351c4f9e08fdb506d0843f377e20a02641fbb2ac15c78
https://github.com/nodejs/node/pull/65273/changes#diff-2495cd91c53a338612a351c4f9e08fdb506d0843f377e20a02641fbb2ac15c78
https://github.com/nodejs/node/pull/65273/changes#diff-2495cd91c53a338612a351c4f9e08fdb506d0843f377e20a02641fbb2ac15c78
https://github.com/nodejs/node/pull/65273/changes#diff-2495cd91c53a338612a351c4f9e08fdb506d0843f377e20a02641fbb2ac15c78
https://github.com/nodejs/node/pull/65273/changes#diff-2495cd91c53a338612a351c4f9e08fdb506d0843f377e20a02641fbb2ac15c78
https://github.com/nodejs/node/pull/65273/changes#diff-2495cd91c53a338612a351c4f9e08fdb506d0843f377e20a02641fbb2ac15c78
https://github.com/nodejs/node/pull/65273/changes#diff-2495cd91c53a338612a351c4f9e08fdb506d0843f377e20a02641fbb2ac15c78
https://github.com/nodejs/node/pull/65273/changes#diff-2495cd91c53a338612a351c4f9e08fdb506d0843f377e20a02641fbb2ac15c78
https://github.com/nodejs/node/pull/65273/changes#diff-2495cd91c53a338612a351c4f9e08fdb506d0843f377e20a02641fbb2ac15c78
https://github.com/nodejs/node/pull/65273/changes#diff-2495cd91c53a338612a351c4f9e08fdb506d0843f377e20a02641fbb2ac15c78
Please reload this pagehttps://github.com/nodejs/node/pull/65273/changes
Please reload this pagehttps://github.com/nodejs/node/pull/65273/changes
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.