As Mozilla aims to improve JavaScript performance in Firefox

Apr 29, 2011 09:50 GMT  ·  By

While Firefox seems to be playing catch-up more than anything else lately, there are people at Mozilla looking ahead as well. With the new fast release cycle, it possible that Firefox will once again take the lead, at least in some areas.

Firefox 4 includes the new JägerMonkey engine which is already a big improvement over the previous TraceMonkey. The latest Mozilla browser is mostly on par and keeping up with other modern browsers, but it's not winning any speed races.

But Mozilla working on the next iteration of its JavaScript engine, as Cnet noted. There are several enhancements planned for the JS engine this year, now that JägerMonkey is out of the way.

Mozilla's David Mandelin has laid out the major plans. One area which should have an effect on performance in real-time applications, such as animation, is improving the way garbage collection is handled by Firefox.

Mozilla plans to optimize garbage collection by chopping down the task and doing it in several smaller steps rather than in one fell swoop. This should greatly help with the periodic slowdowns the current method creates.

The next Firefox JavaScript just-in-time (JIT) compiler will be named IonMonkey.

"Like Crankshaft, it will feature SSA compiler IRs (intermediate representations), which will facilitate advanced optimizations... such as type specialization, function inlining, linear-scan register allocation, dead-code elimination, and loop-invariant code motion," Mandelin explained.

IonMonkey is still in the planning stages, but work is about to get underway so there should be some tangible results later in the year.

Web developers should be looking forward to the new Debugging API also in the planning. It's a completely new API with some interesting features such as remote debugging which should come in rather handy for mobile devices, for example.

"The new API will provide a cleaner interface and better isolate debuggers from the program they are debugging. This should make Firefox debugging tools stabler and easier to work on. The most exciting part is that the new debug API allows remote connections," Mandelin detailed. "Jim Blandy designed the API last year, so now we just need to implement it."