Skip to main navigation Skip to search Skip to main content

Reusing the optimized code for javascript ahead-of-time compilation

  • Hyukwoo Park*
  • , Sungkook Kim
  • , Jung Geun Park
  • , Soo Mook Moon
  • *Corresponding author for this work
  • Seoul National University

Research output: Contribution to journalJournal articlepeer-review

Abstract

As web pages and web apps increasingly include heavy JavaScript code, JavaScript performance has been a critical issue. Modern JavaScript engines achieve a remarkable performance by employing tiered-execution architecture based on interpreter, baseline just-in-time compiler (JITC), and optimizing JITC. Unfortunately, they suffer from a substantial compilation overhead, which can take more than 50% of the whole running time. A simple idea to reduce the compilation overhead is ahead-of-time compilation (AOTC), which reuses the code generated in the previous run. In fact, existing studies that reuse the bytecode generated by the interpreter or the machine code generated by the baseline JITC have shown tangible performance benefits [12, 31, 41]. However, there has been no study to reuse the machine code generated by the optimizing JITC, which heavily uses profile-based optimizations, thus not easily reusable. We propose a novel AOTC that can reuse the optimized machine code for high-performance JavaScript engines. Unlike previous AOTCs, we need to resolve a few challenging issues related to reusing profile-based optimized code and relocating dynamic addresses. Our AOTC improves the performance of a commercial JavaScript engine by 6.36 times (max) and 1.99 times (average) for Octane benchmarks, by reducing the compilation overhead and by running the optimized code from the first invocation of functions. It also improves the loading time of six web apps by 1.28 times, on average.

Original languageEnglish
Article number54
JournalACM Transactions on Architecture and Code Optimization
Volume15
Issue number4
DOIs
StatePublished - 2018

Keywords

  • ahead-of-time compilation
  • JavaScript
  • JavaScriptCore engine
  • optimizing just-in-time compilation
  • web app

Fingerprint

Dive into the research topics of 'Reusing the optimized code for javascript ahead-of-time compilation'. Together they form a unique fingerprint.

Cite this