Feeds

Firefox engine outraces self after Jäger shot

SpiderMonkey amps up

Internet Security Threat Report 2014

Mozilla has announced that JägerMonkey — the still-gestating JavaScript engine extension set to arrive with Firefox 4.0 this fall — is now faster than the TraceMonkey extension used by the current Firefox 3.6.

"JägerMonkey has crossed the streams," developer David Anderson said in a Tuesday blog post, boasting that the JägerMonkey performance line had passed TraceMonkey's when running the V8 benchmark suite. "It’s not by a lot, but this gap will continue to widen, and it’s an exciting milestone."

JagerMonkey performance

JagerMonkey (black) v TraceMonkey (orange) running the V8 benchmark

(Google's JavaScript engine is in green, at the bottom)

JägerMonkey is a method JIT compiler that uses the Nitro assembler from Apple’s open-source WebKit project, the same assembler used by Google Chrome and Apple Safari. The ultimate aim is to marry this compiler with TraceMonkey, Mozilla's trace JIT, so that Firefox can trace JavaScript code when it's appropriate but fall back on a method compiler when it's not.

Since unveiling the JägerMonkey project in late February, Anderson says, Mozilla has rewritten the extension from scratch. Anderson and team decided to retool the entire platform in early May, and by June they were ready to start optimizing again. The new version is now faster than the old.

Ultimately, Mozilla wants to offer a JavaScript engine that's at least as fast as the competition — if not faster. And Anderson hopes to match the competition even when tracing is not enabled.

At this point, the developers have yet to actually integrate JägerMonkey and TraceMonkey, and, well, they're not quite sure how this will work. "What about tracer integration? This is a tough one to answer, and people are really curious! The bad news is we’re pretty curious too — we just don’t know what will happen yet. One thing is sure: if not carefully and properly tuned, the tracer will negatively dominate the method JIT’s performance," Anderson writes.

"The goal of JägerMonkey is to be as fast or faster than the competition, whether or not tracing is enabled. We have to integrate the two in a way that gives us a competitive edge. We didn’t do this in the first iteration [of JägerMonkey, before it was rewritten]."

TraceMonkey speeds performance by detecting code loops and converting them into assembly language, a trick that Mozilla's competitors have yet to adopt. But there are times when such "tracing" doesn't work. "Loops can throw curveballs that cause tracing to stop," Anderson said in announcing JägerMonkey, aka JäegerMonkey and JagerMonkey and JaegerMonkey. "Especially with recursion, or lots of nesting, it can be very difficult to build good traces on complex code."

Currently, when this sort of thing happens, Firefox reverts to 2007. "When tracing fails, we have to fall back to our old-school interpreter. At that point your JavaScript runs about as fast as it would in 2007-2008 (i.e. before Firefox 3.5, Safari 4, Chrome, etc)," Anderson explained.

JägerMonkey is designed to solve this problem. TraceMonkey will work to convert loops, but when it can't, JägerMonkey will convert entire methods into assembly code. Both will operate under the aegis of SpiderMonkey, Mozilla's overarching JavaScript engine. Whereas JägerMonkey will use the Nitro assembler from WebKit, TraceMonkey uses its own native code assembler, known as nanojit.

Jagermonkey diagram

JägerMonkey borrows the Nitro assembler from WebKit

Anderson says the team hopes to have JägerMonkey ready by September 1. Firefox 4.0 is already in beta, and the official release is due in November. By September, Anderson says, "Integration with the tracing JIT must work, without degrading method JIT performance." ®

Secure remote control for conventional and virtual desktops

More from The Register

next story
Netscape Navigator - the browser that started it all - turns 20
It was 20 years ago today, Marc Andreeesen taught the band to play
Sway: Microsoft's new Office app doesn't have an Undo function
Content aggregation, meet the workplace ... oh
Sign off my IT project or I’ll PHONE your MUM
Honestly, it’s a piece of piss
Return of the Jedi – Apache reclaims web server crown
.london, .hamburg and .公司 - that's .com in Chinese - storm the web server charts
NetWare sales revive in China thanks to that man Snowden
If it ain't Microsoft, it's in fashion behind the Great Firewall
Chrome 38's new HTML tag support makes fatties FIT and SKINNIER
First browser to protect networks' bandwith using official spec
prev story

Whitepapers

Forging a new future with identity relationship management
Learn about ForgeRock's next generation IRM platform and how it is designed to empower CEOS's and enterprises to engage with consumers.
Why cloud backup?
Combining the latest advancements in disk-based backup with secure, integrated, cloud technologies offer organizations fast and assured recovery of their critical enterprise data.
Win a year’s supply of chocolate
There is no techie angle to this competition so we're not going to pretend there is, but everyone loves chocolate so who cares.
High Performance for All
While HPC is not new, it has traditionally been seen as a specialist area – is it now geared up to meet more mainstream requirements?
Intelligent flash storage arrays
Tegile Intelligent Storage Arrays with IntelliFlash helps IT boost storage utilization and effciency while delivering unmatched storage savings and performance.