0ctave/node-sync — Issue #10: performance
Author: dvv
Created: 2011-11-27 06:58:50+00:00
State: open

Hi! The following:

```js
var Sync = require('sync');

function worker(a, b, callback) {
process.nextTick(function() {
callback(null, a + b);
});
}

var t0 = new Date;

var n = 100000;
function run(err, result) {
if (!n) {
console.log('ASYNC', result, new Date - t0);
t0 = new Date;
Sync(function() {
var result = 0;
for (var n = 100000; --n >= 0; ) {
result = worker.sync(null, 0, n + result);
}
console.log('SYNC', result, new Date - t0);
process.exit(0);
});
}
--n;
worker(0, result + n, run);
}
run(null, 0);
```

shows sync is slower circa 5-6 times than async. Please, validate/void this example and results.

TIA,
--Vladimir