A fast in-place interpreter for WebAssembly

05/02/2022
by   Ben L. Titzer, et al.
0

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.

READ FULL TEXT

page 6

page 8

page 9

page 11

page 16

page 17

page 18

page 19

research
05/22/2023

Whose Baseline (compiler) is it anyway?

Compilers face a intrinsic tradeoff between compilation speed and code q...
research
06/17/2022

WaTZ: A Trusted WebAssembly Runtime Environment with Remote Attestation for TrustZone

WebAssembly (Wasm) is a novel low-level bytecode format that swiftly gai...
research
12/27/2019

TASE: Reducing latency of symbolic execution with transactional memory

We present the design and implementation of a tool called TASE that uses...
research
02/21/2020

Snel: SQL Native Execution for LLVM

Snel is a relational database engine featuring Just-In-Time (JIT) compil...
research
12/06/2022

Formally Verified Native Code Generation in an Effectful JIT – or: Turning the CompCert Backend into a Formally Verified JIT Compiler

Modern Just-in-Time compilers (or JITs) typically interleave several mec...
research
07/22/2018

Taint Tracking for WebAssembly

WebAssembly seeks to provide an alternative to running large and untrust...
research
10/11/2021

Parsing Data Formats of the Inputs and Outputs of Geographic Models with Code Analysis

Model web services provide an approach for implementing and facilitating...

Please sign up or login with your details

Forgot password? Click here to reset