Archive for September 25th, 2008

The Browser Arms Race

These are exciting times for the web. The second half of 2008 has been really great for browsers in general and javascripts engines in particular. There have been a lot of excitement with the release of Mozilla Firefox 3.0 and Google Chrome. IE 8 is in beta and Opera is making their releases regularly with browsers trying to beat each other in speed for being standards-compliant using tests such as ACID3.

Also the web is slowly but surely moving from webpages and portal towards desktop-like apps with more and more applications being built using javascript and DHTML. Better and faster connectivity is making web applications accessible to all. The weak link so far were the buggy and slow javascript interpreters.

Various Javascript engines embedded in browsers are becoming faster and faster and it has led to an arms race. A short chronology of events follows:

1. Safari has really taken off after support from Apple with a great number of improvements over the past year. Safari was the first to fire a salvo with annoucement of a new Javascript engine called Squirrelfish. Squirrelfish was faster than SpiderMonkey – the default javascript engine embedded in FF 2.x and FF 3.0. Squirrelfish was faster than Tamarin. (Tamarin is a high-performance implementation of JS 2).

2. Not the one to be left behind, Firefox came up with a update to SpiderMonkey called TraceMonkey which makes use of “trace trees” to optimise and speedup Javascript code. the result was even faster Javascript execution.

3. In the midst of all this arms race, Google Chrome unleashed the V8 engine (named after the V8 engines from F1 cars), adding another dimension to this race. V8 was supposed to be faster than every other Javascript engine out there. One of the problems with V8 was that it cannot ported very easily to other platforms.

4. Mozilla then published benchmarks to disprove the claim. Brendan Eich blog post showed that Tracemonkey was faster than V8. Don’t expect the battle to stop here though. Andreas Gals nice post on Tracemonkey explains why it is faster.

5. Recently Squirrelfish-extreme was released which again raised the bar on Javascript engine performance.

What was most surprising was that many of the javascript engines were not written with optimisation in mind. They do not make use of the compiler optimisations which are fairly standard in compilers. It’s nice to see that it happening now.

Get Adobe Flash playerPlugin by wpburn.com wordpress themes