Feeds

Firefox engine outraces self after Jäger shot

SpiderMonkey amps up

Secure remote control for conventional and virtual desktops

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." ®

Intelligent flash storage arrays

Whitepapers

Why and how to choose the right cloud vendor
The benefits of cloud-based storage in your processes. Eliminate onsite, disk-based backup and archiving in favor of cloud-based data protection.
Getting started with customer-focused identity management
Learn why identity is a fundamental requirement to digital growth, and how without it there is no way to identify and engage customers in a meaningful way.
Reg Reader Research: SaaS based Email and Office Productivity Tools
Read this Reg reader report which provides advice and guidance for SMBs towards the use of SaaS based email and Office productivity tools.
The next step in data security
With recent increased privacy concerns and computers becoming more powerful, the chance of hackers being able to crack smaller-sized RSA keys increases.
Storage capacity and performance optimization at Mizuno USA
Mizuno USA turn to Tegile storage technology to solve both their SAN and backup issues.