TY - GEN
T1 - Improving javascript performance by deconstructing the type system
AU - Ahn, Wonsun
AU - Choi, Jiho
AU - Shull, Thomas
AU - Garzarán, María J.
AU - Torrellas, Josep
N1 - Copyright:
Copyright 2014 Elsevier B.V., All rights reserved.
PY - 2014
Y1 - 2014
N2 - 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%.
AB - 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%.
KW - Dynamic typing
KW - Hidden class
KW - Inline caching
KW - Javascript
KW - Prototype
KW - Scripting language
KW - Type spe- cialization
UR - http://www.scopus.com/inward/record.url?scp=84901593820&partnerID=8YFLogxK
UR - http://www.scopus.com/inward/citedby.url?scp=84901593820&partnerID=8YFLogxK
U2 - 10.1145/2594291.2594332
DO - 10.1145/2594291.2594332
M3 - Conference contribution
AN - SCOPUS:84901593820
SN - 9781450327848
T3 - Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI)
SP - 496
EP - 507
BT - PLDI 2014 - Proceedings of the 2014 ACM SIGPLAN Conference on Programming Language Design and Implementation
PB - Association for Computing Machinery
T2 - 35th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2014
Y2 - 9 June 2014 through 11 June 2014
ER -