Software Programs

Pedal to the Chrome Metal: Google Turbocharges V8 With Adaptive Javascript Compiler Called Crankshaft

Chrome’s speedy V8 engine is about to get even faster as Google puts forth a new adaptive compiler called Crankshaft.

Google cites "aggressive" optimizations that help Crankshaft crank up the speed (no pun intended) of JavaScript execution by a large margin. 

But what does it mean for you and me? Think smoother performance in complex web pages, increased responsiveness, and even faster loading times for heavy-duty web apps like Gmail.

The search monster recorded a twelve percent improvement for page load performance in heavy-laden JavaScript pages – not much, but not so insignificant either. If this isn’t mind-bowling data point for you, how about this one: Crankshaft boosts V8’s performance by a whooping fifty percent on the V8 benchmark suite. 

Put simply, the company notes, it’s Chrome’s "biggest performance improvement" since its launch in 2008. 

But how does Crankshaft accomplish such a steep speed increase, you ask. Take it from Kevin Millikin and Florian Schneider, both software engineers with Google:

Crankshaft uses adaptive compilation to improve both start-up time and peak performance. The idea is to heavily optimize code that is frequently executed and not waste time optimizing code that is not. Because of this, benchmarks that finish in just a few milliseconds, such as SunSpider, will show little improvement with Crankshaft. The more work an application does, the bigger the gains will be.

Crankshaft consists of four components: a base compiler, a runtime profiler, an optimizing profiler, and runtime support. Those four technologies work together to analyze JavaScript code at runtime, profile weak spots, and reshuffle the code so it runs faster. Oh, and it’s clever, too. For example, Google says:

Deoptimization support allows the optimizing compiler to be optimistic in the assumptions it makes when generating code. With deoptimization support, it is possible to bail out to the code generated by the base compiler if the assumptions in the optimized code turn out to be too optimistic.

Don’t worry if you didn’t understand this quite geeky explanation, all you need to know is that Crankshaft technology will find its way into the next major Chrome release and that your favorite web apps will feel snappier and more like desktop software.

Meanwhile, enthusiasts willing to take the plunge right now can do so by downloading the latest Canary build of Chrome for 32-bit Intel platforms, while work on 64-bit Intel and ARM ports has just started.

Source: The Cromium blog