paperbot · PL 论文追踪

全部论文 待读 收藏

P2 A fast in-place interpreter for WebAssembly

面向 WebAssembly 的快速原地解释器
OOPSLA 6(OOPSLA2)2022匹配度 1/10 · 该论文属于程序语言与运行时系统方向,聚焦 WebAssembly 原地解释器的启动速度与内存效率,未涉及静态分析、LLM/Agent、浮点程序分析或贝叶斯程序分析,与用户研究画像的核心交叉方向基本无关。引用 43 inbox
Ben L. Titzer
crossref: 2026-09-10

AI 速览

一句话:提出无需改写、无需独立内部格式的 WebAssembly 原地解释器,性能媲美解释定制格式。

WebAssembly(Wasm)是紧凑、规范良好的字节码格式,旨在作为可移植的编译目标并提供接近原生的执行速度,其设计初衷并非直接解释执行。在 JIT 场景中,编译时间与内存消耗严重影响应用启动,因此许多引擎后来采用更快的单遍(baseline)编译器;但 baseline 编译器仍需耗时,并为不常执行的代码浪费代码空间。典型解释器又不可行,于是部分引擎将 Wasm 编译为更紧凑、易解释的格式,这同样耗时耗内存。本文提出一种快速原地解释器,直接解释 Wasm 字节码,无需重写也无需单独格式。评估表明,原地解释 Wasm 代码空间高效且速度快,性能与解释定制设计的内部格式相当,填补了 Wasm 执行层配置中的空白,可实现比以往更快的启动与更低的内存占用。

问题
Wasm 并非为直接解释而设计,而 JIT 场景下编译时间与内存开销严重影响启动;baseline 编译器和转译为紧凑中间格式仍耗时且浪费空间。
方法
提出原地解释器,直接解释原始 Wasm 字节码,无需代码重写,也无需转换为任何独立的内部表示格式。
评估
通过性能与空间效率评估,表明原地解释 Wasm 的性能与解释专门设计的紧凑内部格式相当,并能降低启动时间与内存占用。
原文摘要(Abstract)

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 faster single-pass (baseline) 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.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@article{paperbot1459,
  title = {A fast in-place interpreter for WebAssembly},
  author = {Ben L. Titzer},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {6},
  number = {OOPSLA2},
  year = {2022},
  doi = {10.1145/3563311}
}