DocumentCode :
3708170
Title :
Javascript ahead-of-time compilation for embedded web platform
Author :
Hyukwoo Park;Wonki Jung;Soo-Mook Moon
Author_Institution :
Department of Electrical and Computer Engineering Seoul National University Seoul, Republic of Korea
fYear :
2015
fDate :
10/1/2015 12:00:00 AM
Firstpage :
1
Lastpage :
9
Abstract :
Web applications (apps) programmed using HTML, CSS, and JavaScript have advantages in portability and productivity, compared to Android or IOS apps. However, web apps are involved with some performance issue, due to JavaScript with its dynamic typing and prototypes which are difficult to execute efficiently. One popular way of accelerating JavaScript is using the just-in-time compilation (JITC), which translates the JavaScript source code to the machine code at runtime. Unfortunately, JavaScript JITC for web apps suffers from the parsing and compilation overhead seriously, which offsets the performance gain of executing the compiled code. In this paper, we propose ahead-of-time compilation (AOTC) of JavaScript at the client device. We save the code generated by the JITC at the first run of the web app, so that we can reuse the code in the next runs to remove the parsing and the compilation overhead. For the JavaScriptCore (JSC) engine of the WebKit, we developed three AOTCs. Bytecode-AOTC saves the bytecode, so we can omit the parsing overhead. Native-AOTC saves the machine code, so we can omit the compilation as well as the parsing overhead, yet with a higher space overhead. We also developed a selective-AOTC which selects between the two AOTC depending on the performance benefit and the space overhead of a target JavaScript function. We experimented with four web apps on a commercial smart TV. For the JavaScript portion of the app loading time, bytecode-AOTC and native- AOTC achieve 33.5% and 62.1% performance benefit, with a space overhead of 2.3 times and 15.4 times of the original JavaScript source code size, respectively. Selective-AOTC achieves a trade-off of 45.9% performance benefit and a space overhead of 4.7 times. Our evaluation on JavaScript benchmarks also shows a tangible performance gain, although it is lower than web apps. Finally, we compare to the AOTC for V8 engine and discuss some issues.
Keywords :
"Engines","HTML","Loading","Benchmark testing","Reactive power","Cascading style sheets","Runtime"
Publisher :
ieee
Conference_Titel :
Embedded Systems For Real-time Multimedia (ESTIMedia), 2015 13th IEEE Symposium on
Type :
conf
DOI :
10.1109/ESTIMedia.2015.7351768
Filename :
7351768
Link To Document :
بازگشت