Stream: general

Topic: Wasmi v0.32 - New Execution Engine - Faster Than Ever


view this post on Zulip Robin Freyler (May 28 2024 at 10:33):

Link to article: https://wasmi-labs.github.io/blog/posts/wasmi-v0.32/

The article includes tons of startup and execution performance benchmarks including but not limited to Wasmtime, Wasmer, Winch and Stitch runtimes. I thought it might be interesting to the Bytecode Alliance community. :)

view this post on Zulip Ralph (May 28 2024 at 11:14):

hey this is well written!

view this post on Zulip Robin Freyler (May 28 2024 at 11:24):

thank you. :)

view this post on Zulip bjorn3 (May 28 2024 at 16:59):

On reddit you said:

Optimizing JITs: The next step is an optimizing JIT that additionally heavily optimizes the incoming Wasm binary during the machine code generation. Examples include Wasmtime, WAMR and Wasmer.

Technically Wasmtime uses an AOT compiler that just happens to support directly executing the binary in memory without writing it to the disk. The compiler side of the AOT and "JIT" mode are identical down to generating an identical ELF binary in memory and on the disk. The only difference is that the AOT mode writes it to the disk at compile time and maps it at runtime, while the "JIT" mode maps it directly in memory (or on linux writes it to an memfd and then maps this memfd just like it would map a real file in AOT mode)

This is also the reason why wasmtime doesn't do any lazy compilation of functions on the fly or tiering up from Winch to Cranelift even though both Winch and Cranelift are designed to compile individual functions independently from each other and are ABI compatible afaik.

Edit: Missed the "The categories 3. and 4. are even way more complex with all the different varieties of how and when machine code is generated. E.g. there are ahead-of-time JITs, [...]" Did you refer to what Wasmtime does as "ahead-of-time JIT"?

view this post on Zulip Robin Freyler (May 28 2024 at 17:22):

Yes, the "ahead-of-time JIT" is exactly what I was referring to and what you described about how Wasmtime works. :) I am aware that is it a heavily debated topic when to call some compiling software a JIT and when AoT. The problem is that there are so many fine levels of detail that a binary JIT vs AoT question simply cannot be a great answer for most of the design decisions. Thus I came up with the "ahead-of-time JIT" because on one hand-side it compiles all the Wasm ahead-of-time of the first use but also compiles the Wasm just-in-time before the first use. This is compared to a real AoT compiler that compiles something and then just outputs the machine code without execution.

view this post on Zulip Lann Martin (May 28 2024 at 17:46):

I have always found the term "JIT" confusing in this context. To me, if compilation completes before execution starts it isn't JIT. :shrug:

view this post on Zulip Lann Martin (May 28 2024 at 17:48):

And to be clear: "JIT" is often used to describe what Wasmtime does (in contrast to "precompiling"); I just personally feel like it muddies the main distinction of the term


Last updated: Dec 23 2024 at 12:05 UTC