Feb 18, 2011 16:21 GMT  ·  By
Crankshaft leads to a huge boost in V8 Benchmarking Suite performance for Google Chrome 10
   Crankshaft leads to a huge boost in V8 Benchmarking Suite performance for Google Chrome 10

Google released the first beta of the Chrome 10 line earlier. It comes with plenty of interesting new features, but perhaps the biggest thing in Chrome 10 is the huge bump in JavaScript performance.

For something that's been so touted by Google and which led to a heated competition among browser makers, it's amazing to see that such huge improvements can still be made in one fell swoop.

The latest, upgraded version of V8, dubbed Crankshaft, does justice to its muscle-car-inspired name, it's 66 percent faster in Google's own V8 benchmarking suite than the previous version included in Google Chrome 9.

Of course, that's the benchmark Chrome developers use to fine tune JavaScript performance, so you'd expect the browser to great in it. In the real world and in other benchmarks, the improvement will probably be smaller, on average, but it should still be noticeable.

"In our new beta release, JavaScript is as quick as a bunny. With a new speed boost that we previewed in December, Chrome’s JavaScript engine V8 runs compute-intensive JavaScript applications even more quickly than before. In fact, this beta release sports a whopping 66% improvement on the V8 benchmark suite over our current stable release," Google wrote.

Crankshaft was revealed in December last year when it was included in Chromium and Canary builds. It has made its way through the dev channel and is now in the latest Chrome 10 beta.

Crankshaft uses a method dubbed "adaptive compilation" to achieve the speed boosts it manages, in certain situations. Compiling JavaScript code is a frequent method of improving performance, the native code will run a lot faster. However, compilation comes with its own overhead, the key is to find a balance.

Crankshaft does this in several stages. All the code is run through a base compiler initially. A runtime profiler then takes over and monitors which portions of the code are used the most.

Those portions are then run through an optimizer which applies several methods for improving the speed of the resulting complied code. Finally, Crankshaft can also revert back to the initial complied code if the optimizations turn out to be too aggressive or optimistic. The new JavaScript engine doesn't affect all JavaScript code, but the speed boost is bigger the more a piece of code is used.

In the end, Crankshaft is the biggest single improvement to JavaScript performance in Chrome since it launched. Considering that the team regularly makes big strides and that the browser is already the fastest or very close to being the fastest (the competitions is very heated), the speed gain is commendable.