Proceedings of ISP RAS


Approaches to Optimizing V8 JavaScript Engine

Dmitry Botcharnikov (LLC Samsung R&D Institute Rus)

Abstract

JavaScript is one of the most popular programming languages in the world. Started as a simple scripting language for web browsers it now becomes language of choice for millions of engineers in the web, mobile and server-side development. However its interpretational nature doesn’t always provide adequate performance. To speed up execution of JavaScript programs there were developed several optimization techniques in recent years. One example of modern high-performing JavaScript engine is a V8 engine used in Google Chrome browser and node.js web server among others. This is an open source project which implemented some advanced optimization methods including Just-in-Time compilation, Polymorphic Inline Caches, optimized recompilation of hot code regions, On Stack Replacement &c. In previous year we were involved in project of optimizing performance of V8 JavaScript engine on major benchmark suites including Octane, SunSpider and Kraken. The project was quite time limited, however we achieved about 10% total performance improvement compared to open source version. We have decided to focus on following approaches to achieve the project’s goal: optimized build of V8 itself, because total running time is shared between compilation and execution; tuning of V8 runtime options which default values may not be always optimal; implementation of additional scalar optimizations. All of these approaches have made contribution to final result.

Keywords

JavaScript; optimizations; V8; common subexpression eimination

Edition

Proceedings of the Institute for System Programming, vol. 27, issue 6, 2015, pp. 21-32.

ISSN 2220-6426 (Online), ISSN 2079-8156 (Print).

DOI: 10.15514/ISPRAS-2015-27(6)-2

Full text of the paper in pdf Back to the contents of the volume