Skip to content

Commit 16ad4b7

Browse files
author
Ruben Bridgewater
committed
node: improve process.nextTick performance
Using a predefined array size prevents resizing the array and is therefor faster.
1 parent dc6403e commit 16ad4b7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/node.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -457,9 +457,9 @@
457457

458458
var args;
459459
if (arguments.length > 1) {
460-
args = [];
460+
args = new Array(arguments.length - 1);
461461
for (var i = 1; i < arguments.length; i++)
462-
args.push(arguments[i]);
462+
args[i - 1] = arguments[i];
463463
}
464464

465465
nextTickQueue.push(new TickObject(callback, args));

0 commit comments

Comments
 (0)