[x] stream: lazy allocate
Lazy allocate potentially unused state objects.
streams/creation.js kind='duplex' n=1000000 *** 5.57 % ±1.65% ±2.21% ±2.89%
streams/creation.js kind='readable' n=1000000 *** 6.55 % ±2.70% ±3.60% ±4.70%
streams/creation.js kind='transform' n=1000000 *** 2.51 % ±1.41% ±1.88% ±2.45%
streams/creation.js kind='writable' n=1000000 0.04 % ±1.60% ±2.13% ±2.79%
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines