Feeds

Firefox engine outraces self after Jäger shot

SpiderMonkey amps up

The essential guide to IT transformation

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

5 things you didn’t know about cloud backup

More from The Register

next story
The Return of BSOD: Does ANYONE trust Microsoft patches?
Sysadmins, you're either fighting fires or seen as incompetents now
China hopes home-grown OS will oust Microsoft
Doesn't much like Apple or Google, either
Sin COS to tan Windows? Chinese operating system to debut in autumn – report
Development alliance working on desktop, mobe software
Linux turns 23 and Linus Torvalds celebrates as only he can
No, not with swearing, but by controlling the release cycle
Microsoft cries UNINSTALL in the wake of Blue Screens of Death™
Cache crash causes contained choloric calamity
Eat up Martha! Microsoft slings handwriting recog into OneNote on Android
Freehand input on non-Windows kit for the first time
Linux kernel devs made to finger their dongles before contributing code
Two-factor auth enabled for Kernel.org repositories
This is how I set about making a fortune with my own startup
Would you leave your well-paid job to chase your dream?
prev story

Whitepapers

Implementing global e-invoicing with guaranteed legal certainty
Explaining the role local tax compliance plays in successful supply chain management and e-business and how leading global brands are addressing this.
5 things you didn’t know about cloud backup
IT departments are embracing cloud backup, but there’s a lot you need to know before choosing a service provider. Learn all the critical things you need to know.
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.
Top 8 considerations to enable and simplify mobility
In this whitepaper learn how to successfully add mobile capabilities simply and cost effectively.
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?