论文标题
WebAssembly的快速现场解释器
A fast in-place interpreter for WebAssembly
论文作者
论文摘要
WebAssembly(WASM)是一种紧凑,指定良好的字节码格式,可提供具有近乎本地执行速度的便携式编译目标。字节码格式专门设计为快速解析,验证和编译,将自己定位为本机代码的便携式替代方案。它不是直接设计的。取而代之的是,当时的设计考虑因素集中于与本机代码竞争,利用优化编译器作为主要执行层。然而,在JIT方案中,编译时间和内存消耗严重影响了应用程序启动,导致许多WASM发动机稍后部署基线(单通行)编译器。尽管更快,但基线编译器仍然需要时间和浪费代码空间,即可执行代码。典型的解释器是不可行的,一些引擎诉诸于机器代码,而是更紧凑,但易于解释的格式。这仍然需要时间并浪费内存。取而代之的是,我们在本文中介绍了WebAssembly的快速现场解释器,其中无需重写且无需单独的格式。我们的评估表明,对WASM代码的现场解释是空间效率和快速的,可以通过解释定制设计的内部格式来实现PAR的性能。这填充了WASM的执行层空间中的一个孔,比以前的发动机配置更快地启动和较低的内存足迹。
WebAssembly (Wasm) is a compact, well-specified bytecode format that offers a portable compilation target with near-native execution speed. The bytecode format was specifically designed to be fast to parse, validate, and compile, positioning itself as a portable alternative to native code. It was pointedly not designed to be interpreted directly. Instead, design considerations at the time focused on competing with native code, utilizing optimizing compilers as the primary execution tier. Yet, in JIT scenarios, compilation time and memory consumption critically impact application startup, leading many Wasm engines to later deploy baseline (single-pass) compilers. Though faster, baseline compilers still take time and waste code space for infrequently executed code. A typical interpreter being infeasible, some engines resort to compiling Wasm not to machine code, but to a more compact, but easy to interpret format. This still takes time and wastes memory. Instead, we introduce in this article a fast in-place interpreter for WebAssembly, where no rewrite and no separate format is necessary. Our evaluation shows that in-place interpretation of Wasm code is space-efficient and fast, achieving performance on-par with interpreting a custom-designed internal format. This fills a hole in the execution tier space for Wasm, allowing for even faster startup and lower memory footprint than previous engine configurations.