Title: stream: add fast paths for webstreams read and pipeTo by mcollina · Pull Request #61807 · nodejs/node · GitHub
Open Graph Title: stream: add fast paths for webstreams read and pipeTo by mcollina · Pull Request #61807 · nodejs/node
X Title: stream: add fast paths for webstreams read and pipeTo by mcollina · Pull Request #61807 · nodejs/node
Description: Add internal fast paths to improve webstreams performance without changing the public API or breaking spec compliance. ReadableStreamDefaultReader.read() fast path: When data is already buffered in the controller's queue, return PromiseResolve() directly without creating a DefaultReadRequest object. This is spec-compliant because read() returns a Promise, and resolved promises still run callbacks in the microtask queue. pipeTo() batch read fast path: When data is buffered, batch reads directly from the controller queue up to highWaterMark without creating PipeToReadableStreamReadRequest objects per chunk. Respects backpressure by checking desiredSize after each write. Benchmark results: pipeTo: ~11% faster (***) buffered read(): ~17-20% faster (***) This was done in partnership with Vercel to improve the performance of React and Next.js, and from a conversation on X with @cramforce.
Open Graph Description: Add internal fast paths to improve webstreams performance without changing the public API or breaking spec compliance. ReadableStreamDefaultReader.read() fast path: When data is already buffered ...
X Description: Add internal fast paths to improve webstreams performance without changing the public API or breaking spec compliance. ReadableStreamDefaultReader.read() fast path: When data is already buffered ...
Opengraph URL: https://github.com/nodejs/node/pull/61807
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:4e731216-487d-85a4-3146-9bcd2ce68d26 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 8F24:955FC:B4783:E9B34:6A4C223E |
| html-safe-nonce | 63c86a28f75fd822b92c295d10d59f4d494b0778a2f423860263260dae80b31f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RjI0Ojk1NUZDOkI0NzgzOkU5QjM0OjZBNEMyMjNFIiwidmlzaXRvcl9pZCI6Ijg5OTA2MDI5OTE3OTE1MTQxNzQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 2aa9a3a4dc50f0fd60c4588d8db95ed7db444a685ed065269cb3765951e55b81 |
| hovercard-subject-tag | pull_request:3282109907 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/nodejs/node/pull/61807/files |
| twitter:image | https://avatars.githubusercontent.com/u/52195?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/52195?s=400&v=4 |
| og:image:alt | Add internal fast paths to improve webstreams performance without changing the public API or breaking spec compliance. ReadableStreamDefaultReader.read() fast path: When data is already buffered ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 1b6b16d04026f131a36d57e3b01d0f4d26a51800edf48bf5ed0256e0ac905511 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f95fb36c72adc940ff991c03531114b2245658d0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width