fast firefox

Mozilla is looking to drastically improve the JavaScript performance in Firefox 3.1 when it is released later this year. When Firefox 3 was released back in June it included a significant boost in the JavaScript performance arena, but will they be able to do it again?

If you decide to download a nightly build of Firefox 3.1 to test out the improved JavaScript performance it’s important to know that the new JavaScript engine, dubbed TraceMonkey, isn’t enabled by default. To enable it you’ll need to open the about:config and find the javascript.options.jit.content setting. Set the value to true by double-clicking on it, and the changes will be applied without needing to restart the browser. Refer to this article if you need help using about:config.

I know you’re wondering how much better it performs, and so I’ll turn your attention to the Sunspider test, which we’ve used in the past to compare the various browsers. I ran all of the following tests on the same MacBook Pro computer with the Mac OS X operating system (lower amount of time is better):

  1. Safari 3.1.2: 3062.0ms
  2. Firefox 3.0: 2997.2ms
  3. Firefox 3.1 nightly without TraceMonkey: 2510.2ms
  4. Firefox 3.1 nightly with TraceMonkey: 1610.4ms

That’s a rather significant difference. Compared to Firefox 3.0 the new Firefox 3.1 nightly build is nearly twice as fast, and my results are consistent with those that Mozilla got. Bravo!

Behind the scenes the optimizations occur when repetitive tasks are done in JavaScript. For example, the folks over at Mozilla whipped up a quick image editor that lets you adjust the brightness and contrast of a photo. It’s nothing fancy, but there is a noticeable difference using Firefox 3.0 compared to Firefox 3.1 with TraceMonkey enabled. That’s because the JavaScript runs significantly faster due to the image editor consistently repeating the same task. Generally that’s how it works, but the nitty gritty details can be found here.

There’s still some work that needs to be done on TraceMonkey, and some bugs need to be ironed out before it will be ready for prime-time. I’m already getting pumped about Firefox 3.1 though.

Thanks natmaster!