wasm-micro-runtime icon indicating copy to clipboard operation
wasm-micro-runtime copied to clipboard

Implement multi-tier compilation framework

Open wenyongh opened this issue 3 years ago • 0 comments

Motivation

Recently another lightweight JIT engine - Fast JIT was developed with quick startup, small footprint and relatively good performance: https://github.com/bytecodealliance/wasm-micro-runtime/issues/1292 To make it work together with LLVM JIT (Orc Lazy JIT), the multi-tier compilation framework is planned to be implemented:

  1. Tier-up from Fast JIT to LLVM JIT to gain quick startup and better performance

Compilation Strategies

There are some possible strategies:

  1. Similar to current LLVM Orc Lazy JIT's strategy Main thread Lazy JIT compilation + Backend threads eager compilation

  2. Similar to V8 JIT tier-up Backend threads with eager compilation to compile all wasm functions with Fast JIT, wait until the compilation ends, then instantiate the wasm module and execute the wasm function. At the same time, launching LLVM JIT to compile wasm functions, and switching to LLVM JIT function gradually when executing.

wenyongh avatar Jul 18 '22 08:07 wenyongh