Feeds

Google 'Crankshaft' inspired by Sun Java HotSpot

Bak to 'adaptive compilation'

Boost IT visibility and business value

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

The essential guide to IT transformation

More from The Register

next story
Munich considers dumping Linux for ... GULP ... Windows!
Give a penguinista a hug, the Outlook's not good for open source's poster child
The Return of BSOD: Does ANYONE trust Microsoft patches?
Sysadmins, you're either fighting fires or seen as incompetents now
Intel's Raspberry Pi rival Galileo can now run Windows
Behold the Internet of Things. Wintel Things
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
prev story

Whitepapers

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.
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.
Build a business case: developing custom apps
Learn how to maximize the value of custom applications by accelerating and simplifying their development.
Rethinking backup and recovery in the modern data center
Combining intelligence, operational analytics, and automation to enable efficient, data-driven IT organizations using the HP ABR approach.
Next gen security for virtualised datacentres
Legacy security solutions are inefficient due to the architectural differences between physical and virtual environments.