$ node bench.js
Threads_a_gogo JS thread -> 4624 (ms) 298607040
Node's main JS thread -> 8471 (ms) 298607040
Ratio: 1.83 times faster
(Sorry, I couldn't resist the temptation)
:-P
--
Jorge.
> are we just seeing the benefit of using 2 cores instead of 1?
No no no, not at all. You're seeing the same piece of JavaScript code running in node's main JavaScript thread vs running it in a thread_a_gogo. Nothing is going on in parallel here, it's simply either one thread or the other.
> would be nice to also have the native node.js script in order to be able to run the benchmark...
Parse error... ?
--
Jorge.
--
Jorge.
--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
http://code.google.com/p/v8/issues/detail?id=2079
--
Vyacheslav Egorov
Yes, thanks for your analysis, Vyacheslav. A fix for that would be über awesome as it would all of a sudden make node almost 2x faster. And the whole node community would then owe you many, many Ks of beers!
--
Jorge.
> > , many Ks of beers!
>
> Is that Kilograms or Kegs?
Thousands :-P
--
Jorge.
--
Vyacheslav Egorov
****** BEFORE:
$ node -e 'console.log(process.versions)'
{ node: '0.7.5',
v8: '3.9.5',
ares: '1.7.5-DEV',
uv: '0.6',
openssl: '0.9.8r' }
$ node Desktop/nextTick.js
loopsPerSecond: 103412616.3, nextTicksPerSecond: 671885.8, ratio: 153.9x times faster
loopsPerSecond: 104602510.5, nextTicksPerSecond: 662346.2, ratio: 157.9x times faster
loopsPerSecond: 114025085.5, nextTicksPerSecond: 658962.3, ratio: 173.0x times faster
loopsPerSecond: 114155251.1, nextTicksPerSecond: 653162.1, ratio: 174.8x times faster
loopsPerSecond: 112233445.6, nextTicksPerSecond: 655562.1, ratio: 171.2x times faster
****** AFTER:
$ node -e 'console.log(process.versions)'
{ node: '0.7.5',
v8: '3.10.5 (candidate)',
ares: '1.7.5-DEV',
uv: '0.6',
openssl: '0.9.8r' }
$ node Desktop/nextTick.js
loopsPerSecond: 353356890.5, nextTicksPerSecond: 750116.9, ratio: 471.1x times faster
loopsPerSecond: 312500000.0, nextTicksPerSecond: 749467.4, ratio: 417.0x times faster
loopsPerSecond: 311526479.8, nextTicksPerSecond: 754602.5, ratio: 412.8x times faster
loopsPerSecond: 313479623.8, nextTicksPerSecond: 747679.7, ratio: 419.3x times faster
loopsPerSecond: 313479623.8, nextTicksPerSecond: 751938.1, ratio: 416.9x times faster
And this <https://gist.github.com/2369318> :
****** BEFORE:
$ node -e 'console.log(process.versions)'
{ node: '0.7.5',
v8: '3.9.5',
ares: '1.7.5-DEV',
uv: '0.6',
openssl: '0.9.8r' }
$ node bench.js
Threads_a_gogo JS thread -> 4712 (ms) 298607040
Node's main JS thread -> 7915 (ms) 298607040
Ratio: 1.68 times faster than main JS thread
New, separate VM -> 4751 (ms) 298607040
Ratio: 1.01 times faster than new VM
****** AFTER:
$ node -e 'console.log(process.versions)'
{ node: '0.7.5',
v8: '3.10.5 (candidate)',
ares: '1.7.5-DEV',
uv: '0.6',
openssl: '0.9.8r' }
$ node bench.js
Threads_a_gogo JS thread -> 4954 (ms) 298607040
Node's main JS thread -> 4794 (ms) 298607040
Ratio: 0.97 times faster than main JS thread
New, separate VM -> 4935 (ms) 298607040
Ratio: 1.00 times faster than new VM
Somehow, now you've broken my threads !
--
Jorge.