Skip to content

stream: remove Array.p.shift primordial from hotpath of RS.read()

Refs: https://github.com/nodejs/performance/issues/82

A small improvement noticed in performance of read():

                                                   confidence improvement accuracy (*)   (**)  (***)
webstreams/readable-async-iterator.js n=100000                     0.75 %       ±1.93% ±2.57% ±3.35%
webstreams/readable-read.js type='byob' n=100000                   0.69 %       ±1.21% ±1.61% ±2.10%
webstreams/readable-read.js type='normal' n=100000        ***      8.81 %       ±1.55% ±2.07% ±2.70%

Merge request reports

Loading