JavaScript in Firefox 3.1 will be wicked fast
John Resig of jQuery fame, has a post about a huge performance boost coming to Firefox 3.1: TraceMonkey.
TraceMonkey, Resig explains, uses a computing technique known as trace trees (PDF) which adds just-in-time native code compilation to SpiderMonkey,
Firefox’s current rendering engine.
What does this mean? As Resig explains:
It means that JavaScript is no longer confined by the previously-challenging resource of processing power. With this improvement it’s leap-frogged any sort of traditional and has gone head-to-head with computationally-powerful languages like C.
In other words, we’ll get JavaScript processing speeds that are Usain Bolt-on-crack fast, opening the door for more powerful JavaScript-powered applications.
Firefox’s announcement comes a few months after the WebKit team’s announcement of SquirrelFish, which will be the JavaScript engine used in Safari 4.
Resig and Brendan Eich also point out that these TraceMonkey improvements (and presumably SquirrelFish’s improvements) in conjunction with HTML 5‘s canvas element will mean we’ll see some slick JavaScript animation and game experiences, such as this one by Zachary Johnson.
The obvious roadblock to widespread adoption of all of this whiz-bangy JavaScript+<canvas> goodness is, of course, Internet Explorer. Internet Explorer 7 does not support the canvas element. Version 8 of the browser will not, although there is a workaround for IE7 available.
Still, without the dominant web browser on board — and conceivably not coming on board for at least a few years — the widespread use of JavaScript animations may not take off for some time.
Want to check see TraceMonkey in action? Download a nightly build of Firefox (codenamed Minefield), and in the about:config panel, set javascript.options.jit.content equal to true.
Also check out Mike Schroepfer’s screencast What can you do when your browser is 7 times faster?