The JavaScript engine is getting an overhaul, TraceMonkey is Out, IonMonkey is in

Nov 2, 2011 20:31 GMT  ·  By
Future versions of Firefox will see some big improvements to JavaScript memory usage
   Future versions of Firefox will see some big improvements to JavaScript memory usage

Mozilla has been working on improving Firefox's memory performance lately. Some of the improvements should already be visible in the latest Firefox 7 stable release, but testing releases, Firefox 8 and Firefox 9 move things even further along.

But Mozilla is not done yet, is is now working on slimming down its JavaScript engine, SpiderMonkey, and has made some rather big changes to come in Firefox 10 and Firefox 11.

As Mozilla notes, SpiderMonkey is being put on a diet. Its inner-workings are being rewritten and redesigned to take up as little space as possible.

Mozilla developer Nicholas Nethercote has all the details on it, but, unless you're a developer too, it's not exactly light reading.

Suffice to say, Mozilla is leaving no stone unturned. Some of the changes have been implemented, but many are in the works while some are just theoretical at this point.

One thing that is more concrete though is that TraceMonkey is being deprecated and is being removed gradually. As of Firefox 9, which introduced type inference, TraceMonkey was disabled for web content.

Patches in Firefox 10, currently in the Nightly channel, have disabled it for the UI and then removed the code from the default build.

The code itself should be removed entirely in Firefox 11. This not only means less memory will be used, it also means that the Firefox executable will be slimmer as well.

This leaves JaegerMonkey as SpiderMonkey's only JIT compiler. But this won't last for long, Mozilla is already working on a new one, IonMonkey that should improve performance while at the same time reduce memory consumption.

There's more, there are plans to improve the JavaScript garbage collector as well, which, if successful, should lead to less memory being tied up even if it's unused. But these are long term plans as well.

Still, what is clear is that Mozilla really wants to drive down memory usage and that future Firefox versions should show bigger and bigger improvements.