Wasmi 2.0 - Engineering of the Fastest Wasm Interpreters
After eight months of dedicated effort, Wasmi 2.0, an efficient and feature-rich WebAssembly (Wasm) interpreter, has been officially released. This release emphasizes execution performance, with Wasmi 2.0 running approximately 2.2 times faster than its predecessor, Wasmi 1.0, in geometric mean across the wasmi-benchmarks suite on an Apple M2 Pro processor.
In addition to improvements in speed, Wasmi 2.0 introduces new features such as the validate crate feature, which significantly reduces binary artifact size. Other enhancements include stable fuel metering support, deterministic profile for WebAssembly, and an improved command-line interface (CLI) tool. The Wasmi project, which has been sponsored by the Stellar Development Foundation (SDF) since October 2024, owes its current state to the generous support of its sponsors and contributors.
This includes frequent acknowledgment of Felix Kutzner for proofreading the article and offering valuable suggestions. Wasmi 2.0's performance gains can be attributed to the implementation of four distinct instruction dispatch modes: Direct-Threaded Code, Indirect-Threaded Code, Switch-Loop, and portable-dispatch + indirect-dispatch.
By default, Wasmi 2.0 utilizes Direct-Threaded Code for maximum performance, although users can opt for other modes based on their specific needs. The interpreter's execution handler signature remains consistent across all dispatch modes, allowing for seamless execution of Wasm bytecode after it has been translated into Wasmi IR.
Written by urgent.news from Lobsters's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.