mirror of https://github.com/nodejs/node.git
stream: remove Array.p.shift primordial from hotpath of RS.read()
Refs: https://github.com/nodejs/performance/issues/82
This commit is contained in:
parent
04f9385311
commit
a836b44efc
|
@ -2084,7 +2084,7 @@ function readableStreamFulfillReadRequest(stream, chunk, done) {
|
|||
reader,
|
||||
} = stream[kState];
|
||||
assert(reader[kState].readRequests.length);
|
||||
const readRequest = ArrayPrototypeShift(reader[kState].readRequests);
|
||||
const readRequest = reader[kState].readRequests.shift();
|
||||
|
||||
// TODO(@jasnell): It's not clear under what exact conditions done
|
||||
// will be true here. The spec requires this check but none of the
|
||||
|
@ -2102,7 +2102,7 @@ function readableStreamFulfillReadIntoRequest(stream, chunk, done) {
|
|||
reader,
|
||||
} = stream[kState];
|
||||
assert(reader[kState].readIntoRequests.length);
|
||||
const readIntoRequest = ArrayPrototypeShift(reader[kState].readIntoRequests);
|
||||
const readIntoRequest = reader[kState].readIntoRequests.shift();
|
||||
if (done)
|
||||
readIntoRequest[kClose](chunk);
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue