Wednesday, September 3rd, 2008

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

Category: JavaScript, Performance

<>p>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.

Related Content:

  • Hot Skills: Ruby and Ruby on Rails
    Ruby is a dynamic, object-oriented programming language which has been in public use since the mid-1990s - longer than either Java or...
  • Ruby on Rails Tutorial
    Ruby on Rails has enjoyed near cult status among programmers who converted to Ruby from Java. Learn about the lightweight framework that many...
  • Managing the climb
    When IT professionals move from a technical role into management it can be a huge culture shock. David Mascord looks at how...
  • How Ruby on Rails and REST go together
    The Rails framework for building Web applications in the dynamic Ruby language is now focused on the REST approach, says the author of a new book of...
  • Learn about Ruby on Rails programming
    Rails, as the combination of the Ruby language and the Rails developer framework is called by its coder legions, is easier to work with than Java. It...

Posted by Dion Almaer at 1:19 pm
2 Comments

+++--
3.8 rating from 16 votes

2 Comments »

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

@cromwellian:
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.