Compilers face an intrinsic tradeoff between compilation speed and code quality.
The tradeoff is particularly stark in a dynamic setting where JIT compilation time contributes to application runtime.
Many systems now employ multiple compilation \textit{tiers}, where one tier offers fast compile speed while another has much slower compile speed but produces higher quality code.
With proper heuristics on when to use each, the overall performance is better than using either compiler in isolation.
At the introduction of WebAssembly into the Web platform in 2017, most engines employed optimizing compilers and pre-compiled entire modules before execution.
Yet since that time, all Web engines have introduced new "baseline" compiler tiers for Wasm to improve startup time.
Further, many new non-web engines have appeared, some of which also employ simple compilers.
In this paper, we demystify single-pass compilers for Wasm, explaining their internal algorithms and tradeoffs, as well as providing a detailed empirical study of those employed in production.
We show the design of a new single-pass compiler for a research Wasm engine that integrates with an in-place interpreter and host garbage collector using value tags, while also supporting flexible instrumentation.
In experiments, we measure the effectiveness of optimizations targeting value tags and find, somewhat surprisingly, that the runtime overhead can be reduced to near zero.
We also assess the relative compile speed and execution time of six baseline compilers and place these baseline compilers in a two-dimensional tradeoff space with other execution tiers for Wasm.
Tue 5 MarDisplayed time zone: London change
10:00 - 11:00 | |||
10:00 20mTalk | One Automaton to Rule Them All: Beyond Multiple Regular Expressions Execution Main Conference Luisa Cicolini Politecnico di Milano, Filippo Carloni Politecnico di Milano, Marco D. Santambrogio Politecnico di Milano, Davide Conficconi Politecnico di Milano Pre-print Media Attached | ||
10:20 20mTalk | Whose Baseline Compiler Is It Anyway? Main Conference Ben L. Titzer Carnegie Mellon University Pre-print | ||
10:40 20mTalk | Enabling Fine-Grained Incremental Builds by Making Compiler Stateful Main Conference Ruobing Han Georgia Institute of Technology, Jisheng Zhao Georgia Institute of Technology, Hyesoon Kim Georgia Institute of Technology Pre-print |