Serious JavaScript performance boost for Firefox 3.1

Mozilla has just landed a new JavaScript optimization feature to Firefox 3.1 development code base (Shiretoko) that effectively enhances JavaScript-based web applications performance by a 2X – 20X fold compared to the already-severely-pumped-up Firefox 3, according to a variety of JavaScript performance tests ran and published by Mozilla’s Brendan Eich.

TraceMonkey tracks the JavaScript code your page is running, identifies pieces that are repeatedly used, and translates that code (interpreted) to an a machine ready state (compiled) that runs much faster the next time it is needed. As this repetitive executions (loops) are very common, the performance gains are huge.

But the best way to understand it is to see it in action. Mozilla’s VP of Engineering, Mike Schroepfer, created a simple JavaScript image editor that lets you adjust a picture’s contrast and brightness with a couple of sliders. With a today’s nightly and TraceMonkey disabled (currently the default as it is still buggy), there is a very noticeable delay while sliding. Turn it on (javascript.options.jit.content = true in about:config) and the thing works just as you would expect: smoothly.

Seems like Firefox 3.1, targeted for first quarter 2009, has just got its must-upgrade feature. With just a couple of months in the wild, Firefox 3 is already starting to look old.

For test details and TraceMonkey background, check Brendan Eich’s TraceMonkey: JavaScript Lightspeed.

10 thoughts on “Serious JavaScript performance boost for Firefox 3.1”

  1. Pingback: Odprta koda – Prosto programje » Firefox 3.0.2 – nova različica

Comments are closed.