Feeds

Google 'Crankshaft' inspired by Sun Java HotSpot

Bak to 'adaptive compilation'

The Power of One Brief: Top reasons to choose HP BladeSystem

Google's new "Crankshaft" JavaScript engine was inspired at least in part by Sun's Java Hotspot performance engine, the reengineered Java virtual machine that Sun released in 1999.

A number of developers who built Crankshaft, including Danish programmer Lars Bak, also worked on HotSpot. Bak led the HotSpot team at Sun, and he's one of the founders of Google's V8 JavaScript engine.

Crankshaft is similar to Mozilla's TraceMonkey-JagerMonkey JavaScript engine setup in that it seeks to optimize certain pieces of code. "At a simple level, they both do dynamic optimization. There's one version of the code that gets 'hot,' gets important, and they take a deeper pass on that code," Google engineer Eric Kay said this morning at the annual Add-on-Con browser conference in Mountain View, California, when we asked about the Crankshaft design and how it compares to Mozilla's engine.

But whereas TraceMonkey uses a technique called "tracing" – detecting code loops and converting them into assembly language – Google's Crankshaft uses an approach known as "adaptive compilation" whereby it identifies all sorts of hot code and optimizes whole methods of code as needed. Sun's HotSpot was based on adaptive compilation, and according to Kay the idea of adding adaptive compilation to the V8 engine has long been on Google's roadmap.

Crankshaft includes four complementary components. In addition to a base compiler, there's a runtime profile that identifies hot code. Then an optimizing compiler recompiles the hot code to offer such optimizations as loop-invariant code motion, linear-scan register allocation, and inlining. Lastly, Google includes "deoptimization support" that identifies cases where the optimizing compiler has promised too much optimization. When this happens, the engine falls back on the base compiler. ®

Securing Web Applications Made Simple and Scalable

More from The Register

next story
Apple fanbois SCREAM as update BRICKS their Macbook Airs
Ragegasm spills over as firmware upgrade kills machines
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
Mozilla fixes CRITICAL security holes in Firefox, urges v31 upgrade
Misc memory hazards 'could be exploited' - and guess what, one's a Javascript vuln
NO MORE ALL CAPS and other pleasures of Visual Studio 14
Unpicking a packed preview that breaks down ASP.NET
Captain Kirk sets phaser to SLAUGHTER after trying new Facebook app
William Shatner less-than-impressed by Zuck's celebrity-only app
Cheer up, Nokia fans. It can start making mobes again in 18 months
The real winner of the Nokia sale is *drumroll* ... Nokia
EU dons gloves, pokes Google's deals with Android mobe makers
El Reg cops a squint at investigatory letters
Chrome browser has been DRAINING PC batteries for YEARS
Google is only now fixing ancient, energy-sapping bug
prev story

Whitepapers

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.
How modern custom applications can spur business growth
Learn how to create, deploy and manage custom applications without consuming or expanding the need for scarce, expensive IT resources.
Reducing security risks from open source software
Follow a few strategies and your organization can gain the full benefits of open source and the cloud without compromising the security of your applications.
Boost IT visibility and business value
How building a great service catalog relieves pressure points and demonstrates the value of IT service management.
Consolidation: the foundation for IT and business transformation
In this whitepaper learn how effective consolidation of IT and business resources can enable multiple, meaningful business benefits.