Feeds

Firefox engine outraces self after Jäger shot

SpiderMonkey amps up

High performance access to file storage

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

High performance access to file storage

More from The Register

next story
This time it's 'Personal': new Office 365 sub covers just two devices
Redmond also brings Office into Google's back yard
Oh no, Joe: WinPhone users already griping over 8.1 mega-update
Hang on. Which bit of Developer Preview don't you understand?
Microsoft lobs pre-release Windows Phone 8.1 at devs who dare
App makers can load it before anyone else, but if they do they're stuck with it
Half of Twitter's 'active users' are SILENT STALKERS
Nearly 50% have NEVER tweeted a word
Internet-of-stuff startup dumps NoSQL for ... SQL?
NoSQL taste great at first but lacks proper nutrients, says startup cloud whiz
IRS boss on XP migration: 'Classic fix the airplane while you're flying it attempt'
Plus: Condoleezza Rice at Dropbox 'maybe she can find ... weapons of mass destruction'
Ditch the sync, paddle in the Streem: Upstart offers syncless sharing
Upload, delete and carry on sharing afterwards?
New Facebook phone app allows you to stalk your mates
Nearby Friends feature goes live in a few weeks
Microsoft TIER SMEAR changes app prices whether devs ask or not
Some go up, some go down, Redmond goes silent
prev story

Whitepapers

Securing web applications made simple and scalable
In this whitepaper learn how automated security testing can provide a simple and scalable way to protect your web applications.
3 Big data security analytics techniques
Applying these Big Data security analytics techniques can help you make your business safer by detecting attacks early, before significant damage is done.
The benefits of software based PBX
Why you should break free from your proprietary PBX and how to leverage your existing server hardware.
Top three mobile application threats
Learn about three of the top mobile application security threats facing businesses today and recommendations on how to mitigate the risk.
Combat fraud and increase customer satisfaction
Based on their experience using HP ArcSight Enterprise Security Manager for IT security operations, Finansbank moved to HP ArcSight ESM for fraud management.