Wednesday, September 3rd, 2008

Brendan discusses how TraceMonkey is climbing faster; Ruby on the Web with V8

Category: JavaScript, Performance

Brendan Eich jumped right in and benchmarked the tip of tree for TraceMonkey, with the V8 version that came with Google Chrome:

We win on the bit-banging, string, and regular expression benchmarks. We are around 4x faster at the SunSpider micro-benchmarks than V8.

This graph does show V8 cleaning our clock on a couple of recursion-heavy tests. We have a plan, to trace recursion (not just tail recursion). We simply haven’t had enough hours in the day to get to it, but it’s “next”.

Brendan shows SunSpider running there, and V8 has that and other benchmarks to run too. Isn’t it great when a performance arms war is on? Thank god for competition here. We all win.

Ray Cromwell ran tests himself, on his own app Chronoscope (note, probably NOT using tip of tree TraceMonkey):

Chronoscope is written in GWT, and to some extent, the GWT compiler may negate some of Chrome’s V8 technology in the sense that GWT “de-classes” many OO polymorphic dispatches into a more functional style of programming, removing as much dynamic dispatch as possible, and eliminating prototype lookups and function call overhead through inlining. I don’t know if GWT hurts “hidden classes” or not, but it might be possible that if GWT didn’t provide such optimizations, the performance differential might be larger.

Despite this, the results are still good. The test consisted of calling the chart’s redraw() function 100 times per trial, with 10 trials. The slowest and fastest trial are thrown out, and the mean and standard deviation are calculated on the remaining data.

I tested on a Mac Pro 2.66Ghz with 6Gb of memory, OSX 1.5. The tests were conducted within a Parallels VM running XP2 Service Pack 2, given 2 CPUs and 2Gb of memory. For each browser, I rebooted the VM from a clean start, and ran only the test browser.

And for a bit of fun, Marc-Andre Cournoyer tied together HotRuby (remember that? the beast that runs YARV code in the browser!) and V8 to create fast Ruby in the browser.

Good times.

Posted by Dion Almaer at 1:19 pm

3.8 rating from 16 votes


Comments feed TrackBack URI

Some people will note that it says “Safari 3.1 (SquirrelFish)”. I presume that the WebKit nightlies for Win32 contain SquirrelFish, and when I run the WebKit nightly batch file, it launches Safari, and the “About” menu item reports 3.1.x It definately is showing a performance difference vs the Apple Safari, so I’m guessing it just launches the Safari app and replaces some DLLs onload.

Comment by cromwellian — September 3, 2008

Glad I read your comment before responding. I was going to point out that SquirrelFish is definitely not in Safari 3.1.x. In fact, I’m not sure that it’s even in the nightlies yet, but I could be wrong. But yes, WebKit has made many performance improvements over the latest Safari release, both before and in SquirrelFish.
As far as the nightlies go, yeah it pretty much runs the Safari shell around the WebKit libraries (but at least on the Mac version anyway, it does not identify as the same application).

Comment by eyelidlessness — September 3, 2008

Leave a comment

You must be logged in to post a comment.