Firefox 3.1's TraceMonkey, color me impressed...

Posted by Dan on Aug 28, 2008 @ 10:45 AM

I just installed the lastest nightly build of Firefox v3.1a2pre, because I was very curious to see how an application I've been working on (which is very JavaScript intensive) would work with Mozilla's new TraceMonkey (JavaScript JIT) engine.

I'm extremely impressed by the performance of the JIT. The application I'm working has a lot of dependencies on JS behaviors that are initialized on page load. I've spent a lot of time to minimize the the impact of this code on page load, but there can be a good 250-1250ms delay (depending on PC hardware, the configuration of the page, etc.) before every element on the page is completely usable. So while there is a delay, I've designed things so that it should be pretty transparent to the user because they see the page immediately and by the time they'd actually go to do anything on the page, everything should be initialized.

While just testing the page under the latest nightly Firefox 3.1 build, this page is blazingly fast. It's so fast, I generally can't even see the initialization occur. I'm very impressed and I think things will only get better.

The addition of JavaScript JIT compilers is just a natural progression and I think it'll be the way we see all browsers head. The dependence on JavaScript in web design is greater than ever and with good reason—it allows us to build better web-based applications. However, with the greater dependence on the usage of JavaScript, it can be a really battle at times to tweak performance out of an application. It looks like TraceMonkey is making great strides in handling this problem natively in the browser.

I definitely recommend reading John Resig's blog post on TraceMonkey. It contains a lot of technical detail as well as a brief overview on how it all works.

Categories: JavaScript, jQuery


  • Fast is good. John's blog post also has pretty graphs... :)
  • After playing around with 3.1 one a little more, even with the JIT turned off, there's still a noticeable performance difference between every other browser I've tested. I'm glad to see performance of the JS interpreter has become such a high priority. This will only lead to developers being able to develop better products.
  • Have you tried Google Chrome yet?
  • @Darin:

    I played around with Chrome for an hour or so on Tuesday when it was released and the JS performance is also impressive. I didn't notice any difference in speed between FF3.1 and Chrome (but I didn't do any indepth analysis either.)

    I know that Chrome's V8 engine does handle recursion tracing--which TraceMonkey currently does not.

Comments for this entry have been disabled.