In association with heise online

01 March 2010, 10:47

Firefox afterburner for JavaScript

  • Twitter
  • Facebook
  • submit to slashdot
  • StumbleUpon
  • submit to reddit

JaegerMonkey is to help Mozilla regain top rank in terms of JavaScript performance. The SpiderMonkey JavaScript engine currently used by programs such as the Firefox web browser clearly falls behind its competitors whenever its TraceMonkey extension fails to kick in. The extension tries to detect code loops and convert them directly into assembler code. If this is successful, the code is executed at very high speed. However, if the JavaScript code doesn't contain many loops or if TraceMonkey fails to detect them, the SpiderMonkey engine defaults to an older and slower interpreter which technologically dates back to 2007. In this case, competitors such as WebKit's interpreter and Safari's Nitro soon leave it behind. Using a more reliable, simpler method, they convert whole functions into assembler code.

JaegerMonkey (also called JägerMonkey in those parts of the community that do umlauts) is to combine the two concepts. Before a function is interpreted, the compiler converts it into generic assembler code. If it detects any loops it hands over to TraceMonkey, otherwise it directly executes the code and bypasses the slow interpreter. First test runs indicate a performance increase of 30 (32-bit code) to 45% (64-bit code) in the SunSpider JavaScript benchmark.

Unlike TraceMonkey, JaegerMonkey currently uses Apple's Nitro JavaScript JIT compiler rather than the Nanojit compiler. Although it is still early days for JaegerMonkey, the developers hope that combining the two concepts will allow them to catch up with their competitors when tracing isn't an option and leave them behind when tracing is available. Some details about JaegerMonkey are available in the blogs of its developers, David Anderson and David Mandelin, as well as from the project's wiki.


Print Version | Send by email | Permalink:

  • July's Community Calendar

The H Open

The H Security

The H Developer

The H Internet Toolkit