Browse Source

Make process.nextTick worlds faster for large queues.

v0.7.4-release
Tim Caswell 14 years ago
committed by Ryan Dahl
parent
commit
81a53e83ab
  1. 7
      src/node.js

7
src/node.js

@ -47,9 +47,12 @@ process.evalcx = function () {
var nextTickQueue = []; var nextTickQueue = [];
process._tickCallback = function () { process._tickCallback = function () {
for (var l = nextTickQueue.length; l; l--) { var l = nextTickQueue.length;
nextTickQueue.shift()(); if (l === 0) return;
for (var i = 0; i < l; i++) {
nextTickQueue[i]();
} }
nextTickQueue.splice(0, l);
}; };
process.nextTick = function (callback) { process.nextTick = function (callback) {

Loading…
Cancel
Save