Files
node/lib
James M Snell 724190cfdc stream: avoid per-write allocations in stream/iter writers
Every write() and writeSync() allocated a `{ __proto__: null, context }`
options object for the WebIDL chunk conversion, and for a Uint8Array
chunk a second, six-property one with [AllowShared] and
[AllowResizable]. Both are created in V8 dictionary mode.

Return Uint8Array chunks directly from the WriterChunk converter: with
[AllowShared] and [AllowResizable], the Uint8Array conversion cannot
reject a value isUint8Array() accepts and returns the same object. Use
shared, frozen conversion contexts for chunks, chunk sequences and
write options; the converters only read them to build error messages.

Writing 1e6 16-byte Uint8Array chunks into a push() stream and reading
them back is about 27% faster with writeSync() and with writevSync()
(4 chunks per call). String chunks are unaffected. Behavior and error
messages are unchanged.

Assisted-by: OpenCode
Signed-off-by: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66648
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
2026-10-15 13:26:46 +00:00
..
2026-09-03 15:37:21 +00:00
…
…
…
…
2026-10-15 00:52:34 +00:00
2026-10-15 00:52:34 +00:00
2026-10-15 00:52:34 +00:00
2026-10-15 00:52:34 +00:00
2026-10-15 00:52:34 +00:00
2026-10-15 00:52:34 +00:00
2026-09-05 02:49:02 +00:00
2026-09-28 04:22:37 +00:00
2026-09-12 11:52:10 +00:00
2026-09-03 11:40:52 +02:00
2026-10-04 03:56:13 +00:00
…
2026-10-15 00:52:34 +00:00
2026-10-15 00:52:34 +00:00
…
2026-10-05 21:26:47 +00:00
2025-12-22 16:14:46 +00:00
2026-07-25 23:56:46 -07:00
2025-09-04 11:58:50 +00:00
…
2026-04-01 10:09:41 +00:00
2026-08-23 15:52:12 +00:00
2026-09-03 11:48:46 +02:00
2026-10-15 07:53:03 +00:00