Internet Explorer

Firefox

Safari

I personally think the friendly rivalry between the open-source Webkit engine (which powers Safari, among other things) and Mozilla (the Gecko engine, actually) is one of the best things to happen to browser development in years. The constant one-upsmanship can only lead to better browsers. Well, Internet Explorer will constantly be the limiting factor, but we can dream, can’t we?

The latest thing to hit browser source repos is javascript engine improvement based on something called “trace trees”: essentially, javascript gets translated into native bytecode. The Webkit engine made the announcement a few months ago, with code codenamed “Squirrelfish,” promising massive improvements. That article’s also got a pretty good writeup.

Open Source being what it is, it was only a matter of time before Mozilla announced their own version of a trace-tree-based javascript engine. John Resig has a good writeup, as done Brendan Eich.

So, disregarding for a moment all talk of trace trees and JIT, what the hell does this all mean? I am entirely in agreement with Jeff Atwood about the importance of javascript in the contemporary web. Whether you’re using rich sites like Netflix or GMail, or you’re working with Flash files, or you’re getting into the RIA arena with Flex or similar technologies, you’re essentially relying on javascript and javascript engines to get anything done. Good HTML specs get the browsing experience much of the way there, but a truly compelling web technology relies on client-side scripting. Even in the last 3 or 4 years, javascript has gone from superfluous UI tricks to the heart and soul of the user’s end of a web experience. It’s a bit unfortunate, really, since javascript (properly “ECMAScript”) is an old technology that’s single-threaded and doesn’t scale very well. That browser-makers have managed to squeeze this much performance out of it is a testament to geek creativity.

There’s been a lot of reason to switch away from Internet Explorer in the last few years. Microsoft made big steps with IE7 to improvement performance, rendering quality, and security, but Internet Explorer is still the bastard child of the browser world, dog-ass slow compared to its brethren. If the difference between user experience in the javascript-heavy web becomes so great that a Webkit browser or a Gecko browser or Opera1 provides an entirely different level of satisfaction, then maybe we’ll finally see a real shift in browser usage.

Mozilla, particularly, is posed to reap some real reward. These JIT trace tree improvements will start showing up in 3.1 (I think), and much more so with the new Tamarin engine schedule for Firefox 4. The only viable Webkit browser in Windows, meanwhile, is Safari2, which looks and feels alien in Windows, as Apple has a strange insistence upon keep the OSX look, regardless of platform. I don’t know offhand the market slice that Safari for Windows occupies, but it must be infinitesimally small, even compared to Safari on Mac. Firefox, then, is the only truly compelling browser on the Windows platform to take advantage of this right now.

  1. I can only assume that Opera will add trace trees to their new javascript engine soon. Perhaps for Opera 10, whenever that is.[]
  2. I don’t include Arora, a Qt/Webkit browser, since it’s still very much a pre-alpha project.[]

4 Comments to “Javascript performance is about to get turbo-charged”

  1. Conor says:

    Have you played around with Minefield yet? I’m not sure when 3.1 is due, but I’d give it a month or two after that. =P

    I’ve only tinkered with it a little—so far it seems stable enough to use as full-time until 3.1, which was a huge surprise to me—and I’ve been impressed with some speed increases on AJAXified sites, but obviously the real-world differences are not quite as impressive as the bar charts everyone is tossing around.

    I tried it on places like Dipity and it still choked a lot, but I’m not willing to blame Firefox for performance issues there, as Dipity is young and likely having a lot of ironing out of code to do on their end.

    Anyway, it’s interesting to say the least. I do recommend you grab it.

  2. Ben says:

    Er, is it enabled in the latest nightlies? I think I’d go for the latest Tracemonkey build.

  3. Ben says:

    Oh, they expose it to about:config? I thought it wasn’t actually enabled at buildtime in the mainstream nightlies.

    Sweet.

Leave a Reply