节点文献

一种采用预先编译的V8引擎优化方法

V8 JavaScript Engine Optimization Method Using Ahead-of-Time Compilation

  • 推荐 CAJ下载
  • PDF下载
  • 不支持迅雷等下载工具,请取消加速工具后下载。

【作者】 王昭邓浩江朱小勇胡琳琳

【Author】 WANG Zhao;DENG Haojiang;ZHU Xiaoyong;HU Linlin;Institute of Acoustics, Chinese Academy of Sciences, National Network New Media Engineering Research Center;University of Chinese Academy of Sciences;

【机构】 中国科学院声学研究所国家网络新媒体工程技术研究中心中国科学院大学

【摘要】 JavaScript作为Web应用的主要编程语言之一,其解释执行、动态类型、面向原型等特性成为限制Web应用性能的主要因素。为了加快JavaScript运行速度,提升Web应用性能,本文提出一种采用预先编译的V8引擎优化方法。该方法将Web应用第一次解释执行过程中热点函数的字节码或机器码进行保存,Web应用下次运行时可以直接运行热点函数已保存的字节码或机器码,避免了热点函数的解释代价和编译代价,而且提出了新的代价模型来确定保存热点函数字节码或机器码带来的时间增益和空间代价。本文在V8引擎最新编译架构上实现了基于字节码的预先编译方法,并使用标准JavaScript引擎测试集进行了性能测试,实验结果表明在Kraken、Octane测试集上分别可以取得11%和13.6%的性能提升。

【Abstract】 As one of the most important program language used in web application, JavaScript’s properties of interpretation execution, dynamic typing, and prototype oriented have become the main factors that restrict the performance of web application. To accelerate the running speed, improve the performance of web application, this paper proposes a V8 JavaScript engine optimization method using ahead-of-time compilation. This method saves the bytecode or native code of hot functions generated in the first running process. The saved code of hot functions can be used in the next run of web application to omit the interpretation and compilation overhead. We also propose a new overhead model to determine the time gain and space overhead when saving the bytecode or native code of hot functions. We implemented bytecode-based ahead-of-time compilation on V8’s new compilation architecture and test it on standard JavaScript test set. The experiment results show that it can achieve 11% and 13.6% performance improvement on Kraken and Octane respectively.

【关键词】 JavaScriptV8引擎JITAOTC
【Key words】 JavaScriptV8 JavaScript EngineJITAhead-of-time Compilation
【基金】 中国科学院战略性科技先导专项课题:SEANET技术标准化研究与系统研制(编号:XDC02010701)
  • 【文献出处】 网络新媒体技术 ,Network New Media Technology , 编辑部邮箱 ,2021年03期
  • 【分类号】TP312.2
  • 【下载频次】87
节点文献中: 

本文链接的文献网络图示:

本文的引文网络