Approaches To Optimizing V8 JavaScript Engine
Approaches To Optimizing V8 JavaScript Engine
net/publication/295901765
CITATIONS READS
0 147
1 author:
Dmitri Botcharnikov
Samsung Advanced Institute of Technology
1 PUBLICATION 0 CITATIONS
SEE PROFILE
All content following this page was uploaded by Dmitri Botcharnikov on 09 October 2018.
We have made investigation on Arndale ARM (Samsung Exynos 5250 CPU) 5. Runtime parameters tuning
development board running Linux with Linaro gcc 4.7 toolchain for the first V8 engine has quite large set of parameters which guides JIT compilation and
investigation and the same board running Android 4.4 with Android NDK 9 Linaro execution of JavaScript programs. We have found that their default values are not
toolchain for the second one. adequate in all cases, e.g. we have found that disabling lazy compilation can
We have specified the following platform options: substantially improve performance.
• -O3 for highest optimization level As noted in Section 2 V8 performs preliminary parsing of each new script source to
separate each individual function. However when we specify parameter ‘--no-lazy’,
• -mcpu=cortex-a15 for target CPU.
it instead compiles all functions at once in given script.
Enabling this mode has various impacts on different benchmark. We can see big
degradation of CodeLoad test score by about 40% while in the same time huge
increase 2.5 times of MandreelLatency test score. The overall increase about 5%
was also reproduced on Galaxy Note 3 devices running Android 4.4.
6. Scalar optimizations
We have tried to implement several well-known scalar optimizations in V8 however
with varying success. In contrast to ahead of time compilers for classic imperative
languages such as C/C++, Pascal, Ada &c., just-in-time compiler has to share time
among analysis, optimization and execution. That’s why sophisticated optimizations
which require thorough analysis don’t necessarily lead to increasing performance in
such case.
As noted in Section 2 the V8 engine performs optimized compilation of ‘hot’
regions similar to off-line compiles did. At this stage PICs already collected type
Fig. 4 Effect of platform options tuning
25 26
Дмитрий Бочарников. Подходы к оптимизации движка JavaScript V8. Труды ИСП РАН, том 27, вып. 6, 2015 г., Dmitry Botcharnikov. Approaches to Optimizing V8 JavaScript Engine. Trudy ISP RAN /Proc. ISP RAS, vol. 27, issue
с.21-32 6, 2015, pp. 21-32
information so we can apply well-known scalar optimization techniques in AST and We have found that running this optimization before and after Global Value
SSA representations. Numbering gives net effect about 2% performance improvement.
The platform used in benchmark was Samsung Galaxy Note 3 with Qualcomm
Snapdragon (N9005) CPU. Devices run Android 4.4.2 (KitKat). Octane benchmark
suite used in tests was Version 9 download from corresponding repository. For
development we use Android NDK r9c on Linux x86_64 Ububtu 12.04 TLS
29 30
Дмитрий Бочарников. Подходы к оптимизации движка JavaScript V8. Труды ИСП РАН, том 27, вып. 6, 2015 г., Dmitry Botcharnikov. Approaches to Optimizing V8 JavaScript Engine. Trudy ISP RAN /Proc. ISP RAS, vol. 27, issue
с.21-32 6, 2015, pp. 21-32
[4]. Hölzle U., Chambers C., Ungar D. Optimizing Dynamically-Typed Object-Oriented
Languages With Polymorphic Inline Caches, ECOOP ‘91 proceedings, Springer Verlag
View publication stats
31 32