This article is more than 1 year old

Google hits TurboFan button on Chrome's JavaScript engine

New compiler tech offers up to 29% speed increase

Google says its new optimizing compiler tech is gradually speeding up JavaScript execution in its Chrome browser – and it one day hopes it can rip out all the old compiler code and replace it with something better.

The new optimizing compiler is known as TurboFan, and it has been shipping as a component of the V8 JavaScript engine since Chrome 41, two stable versions ago.

The online ad giant has only gradually been switching it on for certain types of JavaScript code where it can prove there are performance gains over Crankshaft, the previous compiler, which was introduced in February 2014.

As the Chrome team's Ben Tizer explained in a Tuesday blog post:

It optimizes more code than the previous optimizing compiler, supports flexible and dynamic optimization modes, and enables easier contributions and maintenance. Thanks to these features and more, we've turned on TurboFan for some types of code that were challenging for our previous compiler to optimize, such as asm.js, class literals, with scopes, computed property names and for-of loops.

TurboFan first landed in the Chromium open source code tree in August 2014, in a patch set that comprised some 72,000 lines of code changes.

Among its new features is a brand-new backend that can output x86 and ARM binary code for 32-bit or 64-bit and doesn't share any code with Crankshaft.

Google has already seen some positive results, including a 29 per cent increase in the zlib compression score of Google's Octane benchmark suite. Not every kind of JavaScript code benefits yet, however, so Crankshaft is still used as the default compiler in current Chrome builds.

The plan is to keep improving the compiler and switch it on for more code scenarios as it becomes more universally effective. Chrome users will see the result in the form of gradual JavaScript performance improvements in future versions of the browser.

Google isn't the only one tweaking its JavaScript compiler to improve performance, though. Of its top two competitors in the browser space, Mozilla continues to make improvements in Firefox's IonMonkey compiler, while Microsoft recently introduced a number of upgrades to the compiler in its Chakra engine, which powers both the Edge browser and web standards-based applications for Windows 10. ®

PS: We know the old PC turbo button was a swindle: it either ran the processor at normal speed, or slower for games and similar software that relied on a particular CPU clock speed. Google's TurboFan is an actual speed-up.

More about

TIP US OFF

Send us news


Other stories you might like