Large performance difference between node.js, v8 and Chrome

614 views
Skip to first unread message

Stefan Krause

unread,
May 6, 2013, 1:52:04 PM5/6/13
to v8-u...@googlegroups.com
A few days ago I found a nice article about Dart vs. Java performance: http://dartogreniyorum.blogspot.co.uk/2013/05/performance-optimization-and-dart.html
I wanted to check how well V8 is doing with this benchmark, so I converted to Java code to Javascript, but I ran into an issue I don't understand.

If I execute the javascript code with node.js or with a V8 custom build (git master) the code runs in less than two seconds (V8 32 bit: 1197 msecs, V8 64 bit: 1549 msecs, node.js 64 bit: 1341 msecs). If I run it in the browser is takes more than seven seconds (28.0.1499.0 canary : 7580 msecs27.0.1453.73 beta: 7707 msecs) all on a MBP with OSX 10.8.3. 

The code stresses typed arrays (mostly Float64Array) quite heavily. What could explain that large difference?

The complete code can be downloaded here: http://www.stefankrause.net/js/gmmTest.zip

Regards,
Stefan Krause


Andreas Rossberg

unread,
May 6, 2013, 2:25:53 PM5/6/13
to v8-u...@googlegroups.com
On 6 May 2013 19:52, Stefan Krause <stefan...@gmx.at> wrote:
> A few days ago I found a nice article about Dart vs. Java performance:
> http://dartogreniyorum.blogspot.co.uk/2013/05/performance-optimization-and-dart.html
> I wanted to check how well V8 is doing with this benchmark, so I converted
> to Java code to Javascript, but I ran into an issue I don't understand.
>
> If I execute the javascript code with node.js or with a V8 custom build (git
> master) the code runs in less than two seconds (V8 32 bit: 1197 msecs, V8 64
> bit: 1549 msecs, node.js 64 bit: 1341 msecs). If I run it in the browser is
> takes more than seven seconds (28.0.1499.0 canary : 7580 msecs, 27.0.1453.73
> beta: 7707 msecs) all on a MBP with OSX 10.8.3.
>
> The code stresses typed arrays (mostly Float64Array) quite heavily. What
> could explain that large difference?

For historic reasons, Chrome currently uses a completely different
implementation for typed arrays than the D8 shell (and presumably,
Node). We are working on unifying these implementations right now, and
that should provide a significant performance boost, especially over
the current Chrome implementation.

/Andreas
Reply all
Reply to author
Forward
0 new messages