Improving javascript performance by deconstructing the type system

Wonsun Ahn, Jiho Choi, Thomas Shull, María J. Garzarán, Josep Torrellas

Research output: Chapter in Book/Report/Conference proceedingConference contribution

Abstract

Increased focus on JavaScript performance has resulted in vast performance improvements for many benchmarks. How- ever, for actual code used in websites, the attained improve- ments often lag far behind those for popular benchmarks. This paper shows that the main reason behind this short- fall is how the compiler understands types. JavaScript has no concept of types, but the compiler assigns types to ob- jects anyway for ease of code generation. We examine the way that the Chrome V8 compiler defines types, and identify two design decisions that are the main reasons for the lack of improvement: (1) the inherited prototype object is part of the current object's type definition, and (2) method bind- ings are also part of the type definition. These requirements make types very unpredictable, which hinders type special- ization by the compiler. Hence, we modify V8 to remove these requirements, and use it to compile the JavaScript code assembled by JSBench from real websites. On average, we reduce the execution time of JSBench by 36%, and the dynamic instruction count by 49%.

Original languageEnglish (US)
Title of host publicationPLDI 2014 - Proceedings of the 2014 ACM SIGPLAN Conference on Programming Language Design and Implementation
PublisherAssociation for Computing Machinery
Pages496-507
Number of pages12
ISBN (Print)9781450327848
DOIs
StatePublished - Jan 1 2014
Event35th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2014 - Edinburgh, United Kingdom
Duration: Jun 9 2014Jun 11 2014

Publication series

NameProceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI)

Other

Other35th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2014
CountryUnited Kingdom
CityEdinburgh
Period6/9/146/11/14

Keywords

  • Dynamic typing
  • Hidden class
  • Inline caching
  • Javascript
  • Prototype
  • Scripting language
  • Type spe- cialization

ASJC Scopus subject areas

  • Software

Fingerprint Dive into the research topics of 'Improving javascript performance by deconstructing the type system'. Together they form a unique fingerprint.

  • Cite this

    Ahn, W., Choi, J., Shull, T., Garzarán, M. J., & Torrellas, J. (2014). Improving javascript performance by deconstructing the type system. In PLDI 2014 - Proceedings of the 2014 ACM SIGPLAN Conference on Programming Language Design and Implementation (pp. 496-507). (Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI)). Association for Computing Machinery. https://doi.org/10.1145/2594291.2594332