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‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,9 +457,9 @@
457457

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

465465
nextTickQueue.push(newTickObject(callback,args));

0 commit comments

Comments
(0)