Feeds

Google 'Crankshaft' inspired by Sun Java HotSpot

Bak to 'adaptive compilation'

Build a business case: developing custom apps

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

Gartner critical capabilities for enterprise endpoint backup

More from The Register

next story
Why has the web gone to hell? Market chaos and HUMAN NATURE
Tim Berners-Lee isn't happy, but we should be
Microsoft boots 1,500 dodgy apps from the Windows Store
DEVELOPERS! DEVELOPERS! DEVELOPERS! Naughty, misleading developers!
Mozilla's 'Tiles' ads debut in new Firefox nightlies
You can try turning them off and on again
'Stop dissing Google or quit': OK, I quit, says Code Club co-founder
And now a message from our sponsors: 'STFU or else'
Apple promises to lift Curse of the Drained iPhone 5 Battery
Have you tried turning it off and...? Never mind, here's a replacement
Uber, Lyft and cutting corners: The true face of the Sharing Economy
Casual labour and tired ideas = not really web-tastic
Linux turns 23 and Linus Torvalds celebrates as only he can
No, not with swearing, but by controlling the release cycle
prev story

Whitepapers

Top 10 endpoint backup mistakes
Avoid the ten endpoint backup mistakes to ensure that your critical corporate data is protected and end user productivity is improved.
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.
Backing up distributed data
Eliminating the redundant use of bandwidth and storage capacity and application consolidation in the modern data center.
The essential guide to IT transformation
ServiceNow discusses three IT transformations that can help CIOs automate IT services to transform IT and the enterprise
Next gen security for virtualised datacentres
Legacy security solutions are inefficient due to the architectural differences between physical and virtual environments.