HackerPapers

arXiv:2305.13241cs.PL

Whose baseline compiler is it anyway?

Ben L. Titzer

Early discovery. Linked by one identifiable commenter. This paper is outside the main ranking; a mention is not an endorsement.

Abstract

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 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.

arXiv comments
Journal reference
DOI
Subjects
cs.PLProgramming Languages

On Hacker News

Linked by 1 identifiable commenter in 1 comment across 1 thread, from Nov 2023 to Nov 2023. Found in 3 HN submissions from May 2023 to Mar 2024. Open submission discussions.

Comments linking this paper, per year.

Discussed in comments1 thread

    • Nice work! JIT compilers are a multi-dimensional tradeoff space: memory consumption, startup time, and execution time. I've been experimenting with different ways of visualizing these three dimensions in a tradeoff space. I like the iteration time over time (showing warmup time)…

      titzerView on HNParent context

Submitted to Hacker News

  • Whose baseline (compiler) is it anyway?
  • Show HN: WebAssembly Instrumentation in the Wizard Research Engine

    Hello all, I've been working on research tools for Wasm for some time now, and just today we put up the pre-print for our newest paper "Flexible Non-intrusive Dynamic Instrumentation for WebAssembly" (https://arxiv.org/abs/2403.07973), which will appear in ASPLOS 2024. Two previous papers, one about Wizard's interpreter (https://dl.acm.org/doi/10.1145/3563311) and one about the JIT (https://arxiv.org/abs/2305.13241) have been discussed on HN before. This new paper explains what Wizard is really…

  • Whose Baseline (compiler) is it anyway?

Connected through shared HN threads, not inferred similarity or a recommendation.