一句话:实证对比浏览器中 WebAssembly 与 JavaScript 的执行时间与内存占用,揭示 JIT 优化与内存开销差异。
WebAssembly 作为最新 Web 标准,提供紧凑字节码格式以实现快速加载与执行,人们普遍认为它比 JavaScript 更快,但既有结果并不一致,且缺乏充分研究。本文系统考察浏览器引擎如何优化 WebAssembly 执行,并与 JavaScript 进行对比:作者使用多样化程序测量两者的执行时间与内存占用,分析 JIT 优化在不同语言上的作用。结果显示:(1) Chrome 中的 JIT 优化显著影响 JavaScript 速度,但对 WebAssembly 速度没有明显作用;(2) WebAssembly 的内存占用远高于 JavaScript。作者希望这些发现能帮助 WebAssembly 虚拟机开发者发现优化机会,并推动更深入研究。
WebAssembly is the newest web standard. It defines a compact bytecode format that allows it to be loaded and executed fast. While WebAssembly is generally believed to be faster than JavaScript, there have been inconsistent results when it comes to showing which code is faster. Unfortunately, insufficient study has been conducted to understand the performance benefits of WebAssembly. In this paper, we investigate how browser engines optimize WebAssembly execution in comparison to JavaScript. In particular, we measure their execution time and memory usage with diverse programs. Our results show that (1) JIT optimization in Chrome significantly impacts JavaScript speed but has no discernible effect on WebAssembly speed; (2) WebAssembly uses much more memory than JavaScript. We hope that our findings can help WebAssembly virtual machine developers uncover optimization opportunities.
DOI 原文 ·
@inproceedings{paperbot6584,
title = {Empowering Web Applications with WebAssembly: Are We There Yet?},
author = {Weihang Wang},
booktitle = {ASE},
year = {2021},
doi = {10.1109/ase51524.2021.9678831}
}