2022/05/02 by Ben L. Titzer, Titzer, Ben L. · 3 voices · 2 citations
Computer Science · Engineering · #Advancements in Photolithography Techniques #Advancements in Semiconductor Devices and Circuit Design #Bytecode #Code (set theory) #Code generation #Compile time #Compiler #Computer science #Dead code elimination #Interpreter #Just-in-time compilation #Key (lock) #Memory footprint #Operating system #Parallel computing #Programming language #Redundant code #Software Engineering Research #Source code #Virtual machine #cs.PF #cs.PL
paper · pdf · doi:10.48550/arxiv.2205.01183
published in arXiv (Cornell University) (Cornell University)
arxiv created 2022/05/02 · openalex publication_date 2022/05/02 · arxiv updated 2022/05/04 · openalex created_date 2025/10/10 · openalex updated_date 2026/07/28
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.