James M Snell
778306c001
stream: create stream/iter iterator results with a constructor
...
The iterators of push(), share(), shareSync(), broadcast() consumers
and from() normalization created a `{ __proto__: null, done, value }`
literal for every result. V8 creates such literals in dictionary mode,
which makes them several times more expensive to create and read than
ordinary objects.
Create them with an IterResult constructor whose prototype is a single
frozen, null-prototype object instead. Results have fast properties
and a single shape, and still have no %Object.prototype% in their
prototype chain, so a polluted Object.prototype.then still cannot turn
a result into a thenable. Creating and reading a result is about 5x
faster in a microbenchmark.
benchmark/streams/iter-throughput-share-sync.js improves by 7% to 42%
(more with more consumers) and iter-throughput-share.js by 4-6%;
pipeTo() with small chunks is about 2.5% faster.
This is observable: results are no longer null-prototype objects, so
deepStrictEqual() comparisons against `{ __proto__: null, ... }` no
longer match, and util.inspect() prints them as
`IterResult { done, value }` (the prototype has a non-enumerable
`constructor` for that purpose). The five tests that compared results
that way now compare their own properties, and a new test covers the
result contract and the prototype pollution case.
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-10-03 06:40:59 +00:00
2026-10-12 06:41:16 +00:00
2026-10-03 06:41:28 +00:00
2026-10-15 00:52:34 +00:00
2026-10-07 15:38:44 -03:00
2026-10-08 09:58:29 +00:00
2026-10-05 16:47:38 +00:00
2026-10-07 15:39:57 -03:00
2026-10-07 15:38:44 -03:00
2026-10-07 15:38:44 -03:00
2026-10-07 15:38:44 -03:00
2026-10-07 15:38:44 -03:00
2026-10-07 15:38:44 -03:00
2026-10-07 15:39:57 -03:00
2026-10-07 15:38:44 -03:00
2026-10-07 15:39:57 -03:00
2026-10-07 15:39:57 -03:00
2026-10-07 15:39:57 -03:00
2026-10-07 15:38:44 -03:00
2026-10-07 15:38:44 -03:00
2026-10-07 15:38:44 -03:00
2026-10-07 15:38:44 -03:00
2026-09-28 04:22:37 +00:00
2026-09-28 04:22:37 +00:00
2026-09-30 13:30:42 +00:00
2026-10-05 16:47:38 +00:00
2026-10-05 11:25:07 +00:00
2026-10-05 16:47:38 +00:00
2026-09-30 08:25:52 +00:00
2026-10-03 16:24:37 +00:00
2026-10-14 21:09:57 +00:00
2026-10-05 16:47:39 +00:00
2026-09-30 06:51:22 +00:00
2026-09-30 06:51:19 +00:00
2026-10-07 13:36:40 +00:00
2026-10-07 13:36:48 +00:00
2026-09-26 21:18:43 +00:00
2026-10-03 08:32:22 +00:00
2026-10-15 09:46:38 +00:00
2026-09-30 06:51:21 +00:00
2026-10-15 07:52:41 +00:00
2026-10-05 16:47:38 +00:00
2026-10-11 07:07:49 +00:00
2026-09-26 20:55:09 +00:00
2026-09-27 00:37:25 +02:00
2026-10-04 22:38:33 +02:00
2026-10-10 11:21:51 +00:00
2026-10-10 11:21:51 +00:00
2026-10-10 11:21:51 +00:00
2026-10-10 11:21:51 +00:00
2026-10-05 05:16:57 +00:00
2026-10-05 05:16:57 +00:00
2026-10-05 11:25:07 +00:00
2026-09-28 20:12:21 +00:00
2026-09-28 20:12:21 +00:00
2026-10-02 22:33:38 +00:00
2026-09-30 13:29:54 +00:00
2026-09-26 19:52:53 +00:00
2026-10-10 17:56:05 +00:00
2026-10-10 17:56:05 +00:00
2026-09-30 06:51:24 +00:00
2026-10-10 17:56:04 +00:00
2026-09-26 21:18:43 +00:00
2026-10-13 18:55:52 +00:00
2026-10-10 08:29:37 +00:00
2026-09-30 06:51:24 +00:00
2026-09-30 13:29:54 +00:00
2026-09-29 10:27:53 +00:00
2026-10-10 13:02:45 +00:00
2026-09-28 10:40:58 +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-12 09:13:52 +00:00
2026-10-15 00:52:34 +00:00
2026-09-26 18:27:41 +00:00
2026-10-15 00:52:34 +00:00
2026-09-29 04:38:26 +00:00
2026-10-15 00:52:34 +00:00
2026-09-27 08:10:01 +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-26 14:02:54 +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-30 08:25:50 +00:00
2026-10-15 00:52:34 +00:00
2026-10-15 00:52:34 +00:00
2026-10-06 11:36:02 +00:00
2026-10-06 11:36:02 +00:00
2026-10-06 11:36:02 +00:00
2026-10-15 00:52:34 +00:00
2026-10-15 00:52:34 +00:00
2026-09-30 08:25:48 +00:00
2026-10-06 17:40:45 +00:00
2026-09-30 08:25:47 +00:00
2026-10-05 11:25:07 +00:00
2026-09-27 00:37:26 +02:00
2026-10-05 05:47:29 +00:00
2026-10-15 07:53:03 +00:00
2026-10-02 17:29:27 +00:00
2026-09-28 23:30:13 +00:00
2026-10-05 21:26:47 +00:00
2026-10-05 21:26:47 +00:00
2026-10-05 21:26:47 +00:00
2026-10-05 21:26:47 +00:00
2026-10-05 21:26:47 +00:00
2026-10-05 21:26:47 +00:00
2026-10-15 00:52:34 +00:00
2026-09-30 17:49:14 +00:00
2026-09-27 08:10:15 +00:00
2026-09-27 08:10:15 +00:00
2026-09-27 08:10:15 +00:00
2026-09-26 21:18:48 +00:00
2026-10-10 08:29:51 +00:00
2026-09-26 21:18:43 +00:00
2026-10-08 20:58:31 +00:00
2026-10-15 07:53:03 +00:00
2026-10-13 13:33:55 +00:00
2026-09-26 21:18:43 +00:00
2026-09-26 21:18:43 +00:00
2026-10-05 16:47:38 +00:00
2026-09-26 21:18:43 +00:00
2026-09-26 21:18:43 +00:00
2026-09-26 21:18:43 +00:00
2026-09-26 21:18:43 +00:00
2026-09-26 21:18:43 +00:00
2026-09-26 21:18:43 +00:00
2026-09-26 21:18:43 +00:00
2026-09-26 21:18:43 +00:00
2026-09-26 21:18:43 +00:00
2026-09-26 21:18:43 +00:00
2026-09-26 21:18:43 +00:00
2026-09-26 21:18:43 +00:00
2026-09-26 21:18:43 +00:00
2026-09-26 21:18:43 +00:00
2026-09-26 21:18:43 +00:00
2026-09-26 21:18:43 +00:00
2026-10-03 09:51:01 +00:00
2026-10-13 07:48:55 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-06 17:40:30 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-06 17:17:15 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-10 17:56:22 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-11 16:10:53 +00:00
2026-10-15 07:53:03 +00:00
2026-10-06 05:55:47 +00:00
2026-10-05 16:47:38 +00:00
2026-10-05 16:47:38 +00:00
2026-10-08 03:54:07 +00:00
2026-10-10 14:36:38 +00:00
2026-10-02 16:56:58 +00:00
2026-10-09 15:53:53 +00:00
2026-10-01 05:39:07 +00:00
2026-10-07 06:41:31 +00:00
2026-10-01 05:39:07 +00:00
2026-10-14 18:50:29 +00:00
2026-10-07 02:13:23 +00:00
2026-09-30 02:42:41 +00:00
2026-10-03 06:41:28 +00:00
2026-10-15 13:26:46 +00:00
2026-10-15 13:26:46 +00:00
2026-10-07 20:01:29 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-10 17:56:14 +00:00
2026-10-10 17:56:23 +00:00
2026-10-10 17:56:21 +00:00
2026-10-15 13:26:46 +00:00
2026-10-07 20:01:29 +00:00
2026-10-15 13:26:45 +00:00
2026-10-15 13:26:46 +00:00
2026-10-10 17:56:19 +00:00
2026-10-07 20:01:31 +00:00
2026-10-15 13:26:46 +00:00
2026-10-10 17:56:18 +00:00
2026-10-10 17:56:09 +00:00
2026-10-15 13:26:46 +00:00
2026-10-10 17:56:10 +00:00
2026-10-07 20:01:31 +00:00
2026-10-07 20:01:31 +00:00
2026-10-10 17:56:19 +00:00
2026-10-10 17:56:21 +00:00
2026-09-26 19:32:45 +00:00
2026-10-13 15:25:12 +00:00
2026-10-03 06:41:28 +00:00
2026-10-03 09:50:25 +00:00
2026-09-30 08:25:53 +00:00
2026-09-30 08:25:53 +00:00
2026-09-26 20:46:13 +00:00
2026-10-04 22:40:57 +02:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-05 05:17:09 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +00:00
2026-10-15 07:53:03 +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-27 09:36:07 +00:00
2026-09-29 23:56:19 +00:00
2026-09-29 23:56:19 +00:00
2026-09-29 23:56:19 +00:00
2026-09-29 23:56:19 +00:00
2026-10-04 19:16:34 +00:00
2026-10-07 13:36:37 +00:00
2026-09-29 23:56:19 +00:00
2026-09-29 17:19:28 +00:00
2026-09-29 17:19:26 +00:00
2026-09-29 17:19:32 +00:00
2026-09-29 17:19:25 +00:00
2026-09-26 18:28:17 +00:00
2026-09-26 18:28:17 +00:00
2026-10-05 07:00:09 +00:00
2026-10-13 10:10:59 +02:00
2026-10-14 08:51:58 +00:00
2026-09-27 00:37:25 +02:00
2026-09-26 19:42:29 +00:00
2026-09-26 18:28:05 +00:00
2026-09-29 21:48:17 +00:00
2026-09-26 18:27:53 +00:00
2026-10-03 07:35:17 +00:00
2026-10-15 07:53:03 +00:00
2026-09-29 21:23:49 +00:00