We pump JavaScript using TurboFan

    Hello, Habr! For a long time we did not talk about Google Chrome and simple web technology. Let's fix it.



    As you all probably know, the JavaScript ecosystem is developing in several directions at once. Among the main changes, for example, progress is made in the basic standards of the language - the recent consolidation of the ECMAScript 2015 standards. In addition to such serious changes, the language is developing in many small experiments - for example, Strong Mode.

    Of course, to meet the growing needs and support new technologies, we need a new, flexible, dynamic (just-in-time) compiler, and we worked hard on it for our V8 JavaScript engine.

    TurboFan (note: codename of the new compiler)created from scratch, and in the development process, we took into account the new features of JavaScript. TurboFan can optimize more code and does it more successfully than the previous JIT compiler, supports flexible and dynamic optimization modes. In addition, the new compiler is written taking into account all the experience gained on CrankShaft, which means that it will become much easier to maintain and improve. Thanks to these and some other features, we taught TurboFan to work with those kinds of code that challenged the previous compiler. Optimization problems were with asm.js, class literals, scopes, computed properties, and for-of loops.

    In the current version, the new dynamic compiler is already showing promising performance improvements, including an increase in the results of the zLib test in the benchmarkOctane at 29%.


    TurboFan has been working for some types of code in Google Chrome since version 41, speeding up both traditional content and some features provided by new technologies in JavaScript.

    Over time, we plan to connect the execution of an increasing number of different JavaScript code to the new compiler, and, ultimately, completely replace CrankShaft, speeding up the execution of millions of already written lines of code and ready-made scripts. Stay in touch, we'll tell you something else soon. ;)

    Also popular now: