Feeds

Mozilla vows Google 'Crankshaft' riposte

'Nobody puts Monkey in a corner'

Top three mobile application threats

Mozilla has vowed not to get "left behind" by Google's latest JavaScript engine, codenamed Crankshaft.

With a blog post on Wednesday, Mozilla's David Mandelin mused on Craftshaft's "adaptive compilation" design and said that the Mozilla JavaScript team and developer community "definitely have the skills and resources to enhance" Firefox's JavaScript engine in ways that match Google's work, and he indicated that this will begin after the release of Firefox 4, due early next year.

Today, at the annual Add-on-Con browser conference in Mountain View, California, Mozilla director of products Jay Sullivan told us that the open source outfit sees Crankshaft as yet another example of the major browser vendors pushing each other to improve JavaScript speed. "It's good. At the highest order, the competition continues," he said, after pointing us to Mandelin's blog post.

Mandelin compares Crankshaft to Firefox's existing TraceMonkey JavaScript engine extension. "I have to point out that run-time type specialization for JavaScript was pioneered by Mozilla’s TraceMonkey project," he said. But he also points out that Crankshaft takes the technique several steps further.

Crankshaft consists of four components. There's a base compiler as well as a run-time profiler that identifies hot code – code that's frequently used. Then an optimizing compiler recompiles the hot code to offer such optimizations as loop-invariant code motion, linear-scan register allocation, and inlining. Plus, Google's V8 team has included "deoptimization support", which identifies cases where the optimizing compiler has over-promised on speed improvements. In this case, the engine falls back on the base compiler.

"Crankshaft introduces an optimizing compiler that does complex optimizations, such as register allocation and loop-invariant code motion," as Mozilla's David Mandelin sees it. "These optimizations take time, so they would make startup slow if that was the only compiler. But Crankshaft also has a base compiler that starts fast but doesn’t optimize very much: probably less than the V8 compiler, in fact. Only if the code is predicted to run many times will it be compiled with full optimization."

With TraceMonkey, Mandelin says, Firefox's engine does something similar. But Crankshaft goes further. Unlike Crankshaft, he says, TraceMonkey just records a trace once – a trace being a code loop that gets reused. Crankshaft, it seems, profiles code repeatedly. It also seems that Crankshaft optimizes entire methods rather than just traces. And it uses inline caching.

"Plenty to do after Firefox 4 comes out," Mandelin said . "In the words of [fellow Mozilla developer] David Anderson, 'The game’s back on.'" ®

Seven Steps to Software Security

More from The Register

next story
NO MORE ALL CAPS and other pleasures of Visual Studio 14
Unpicking a packed preview that breaks down ASP.NET
Cheer up, Nokia fans. It can start making mobes again in 18 months
The real winner of the Nokia sale is *drumroll* ... Nokia
Mozilla fixes CRITICAL security holes in Firefox, urges v31 upgrade
Misc memory hazards 'could be exploited' - and guess what, one's a Javascript vuln
Put down that Oracle database patch: It could cost $23,000 per CPU
On-by-default INMEMORY tech a boon for developers ... as long as they can afford it
Google shows off new Chrome OS look
Athena springs full-grown from Chromium project's head
Apple: We'll unleash OS X Yosemite beta on the MASSES on 24 July
Starting today, regular fanbois will be guinea pigs, it tells Reg
HIDDEN packet sniffer spy tech in MILLIONS of iPhones, iPads – expert
Don't panic though – Apple's backdoor is not wide open to all, guru tells us
prev story

Whitepapers

Top three mobile application threats
Prevent sensitive data leakage over insecure channels or stolen mobile devices.
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.
Boost IT visibility and business value
How building a great service catalog relieves pressure points and demonstrates the value of IT service management.
Designing a Defense for Mobile Applications
Learn about the various considerations for defending mobile applications - from the application architecture itself to the myriad testing technologies.
Build a business case: developing custom apps
Learn how to maximize the value of custom applications by accelerating and simplifying their development.