2008-10-23

Upcoming Browser JavaScript Engine Benchmarks

I've seen lots of people recently saying that Firefox's TraceMonkey JavaScript engine blows Google's V8 out of the water...but was a little skeptical so I decided to do some benchmarks of my own. Now with any benchmark, everything here needs to be taken with a grain of salt as performance will certainly vary upon which sites you are viewing. For this test I have used WebKit's SunSpider. Also, since Chrome and Safari do not have native ports available on Linux right now, I had to do the test under Windows XP. The test machine is dual-core so multi-process/threaded apps should show a benefit, but I feel it's totally fair as single-core machines are quickly going the way of the dinosaur and do not accurately represent the future, which is what we're talking about here. Also as Chrome does not have a stable/final release yet, I've compared with many other browsers' development builds.

So let's get to some numbers. On my test machine Chrome completes the SunSpider test with a total time of 2423ms; pretty nice! Ok, now what about Firefox? The current release, 3.0.3 takes 4244ms. Well, what about the new beta for 3.1 that just came out? It scores at 3823ms. So, wait...that's not too terribly much faster than 3.0. Do we have TraceMonkey enabled? Nope. I don't know why, but the default build of FF3.1.beta1 comes with TraceMonkey disabled by default, so after enabling it the results jump down to 1654ms. Wow! That really is faster than Chrome. Ok, so how about "minefield" AKA the nightly trunk build of Firefox (FF-3.1.b2pre-20081023): 1567ms! So yes, yes indeed Firefox 3.1 and the TraceMonkey JavaScript engine are indeed faster than Chrome and it's V8 engine.

So what about the other guys? Well, first off let's try Safari which shares it's webkit rendering engine with Chrome. The current release, 3.1.2 scores at 4894ms. So how about the development build? With webkit-r37604 (and Safari/WebKit's new SquirrelFish JavaScript engine): it goes to 1664ms. That's faster than Chrome/V8 too, but not quite as fast as FF/TM.

Opera's latest release is 9.6, and I didn't manage to find a development build available for it's next version...probably because it's still proprietary unlike the open source competitors we've discussed so far. Opera scores 5979ms which is slower than both Safari and Firefox's current stable releases, but it's still much better off than Internet Explorer. Internet Explorer 7 scores an abysmal 90522ms. That makes it almost 58 times slower than Minefield. Microsoft, that's absolutely pathetic. I didn't get a chance to try out IE8, but from what I understand it's not much better off in the JavaScript department. See update below...

Here's a chart I threw together in OpenOffice of the results. I omitted IE7 because it was such a huge difference that it made it hard to tell the difference between all the others.

sunSpiderBenchmarksChart

Lastly, just for fun I tested my iPhone and Mobile Safari (running firmware 2.0.2), it took 136081ms. But hey, for a device running an ARM @ 412Mhz with 128MB of RAM vs. a full fledged computer with a dual core processor, and a gig of ram...that's still got to be better than Internet Explorer 7 did. I wish I had a Windows Mobile device to test, and a Android/G1 too, but oh well.

So, yes, with TraceMonkey enabled...Firefox reclaims its place as the fastest browser, but Safari and Chrome certainly aren't too far behind either. With this extreme increase in JavaScript performance on it's way...maybe it's time to finally retire the old "web 2.0" buzzphrase and move onto Web 2.1

UPDATE:
Seems I owe Microsoft an apology for not benchmarking IE8 before. They really have made some progress. The following numbers can not be fairly compared with the above because it was ran inside a virtual machine with only access to a single core and half the RAM, but here they are. IE8-beta2 scored at 9542ms. But, for reference, in the same virtual environment Firefox "Minefield" was still able to pull off 1873ms. So, as while still no where near as fast as the other guys, IE8 is lightyears ahead of IE7 in its javascript performance.

4 comments:

Anonymous said...

Also Firefox gets a worse score in SunSpider than it should due to a bug in that test suite, see the second half of this post:

http://blog.mozilla.com/dmandelin/2008/10/06/squirrelfishing-in-regexp-dnajs/

Anonymous said...

Pff, seriously... Firefox usually eats dust on ANY javascript benchmark tests...

Anonymous said...

You can get nightly builds of the Chromium Project if you want to go nuts and get everyone's "absolute latest". I just use the Chromium Nightly Updater when I want an updated copy to test with.

If I remember correctly, the last nightly I tested was something like 25-35% faster than the Chrome Beta (ran in 75-80% of the time).

Just FYI, Opera may be commercial and closed-source, but they are pretty open compared to others. They regularly post alphas and betas. They'll also post development snapshots from time to time, though I don't see anything newer than 9.61 Final so you didn't miss out on testing their latest.

Based on the numbers you put up I'm guessing you didn't forget, but just in case someone else is trying to do the same tests I'd like to toss in:

Remember to disable your Firefox Add-ons and any other browser's extensions/helpers. It makes a difference.

Jyvyn said...

Technical Communications 101 - Don't make 3D bar graphs. They show no more information than their 2D counterparts and are far more difficult to accurately read.

By not following technical writing conventions, it reduces the credibility of the results.