Hi folks, I've been jumping around the wasmtime and cranelift code, mostly for my own education.
Am I correct in understanding that wasmtime always executes a module by JITing the code and then running the JIT-ed code? Does it not follow the LuaJIT model of only generating native code for hot code?
That is correct. Wasmtime does have a cache for the JIT-ed code, so JITing should take less time after the first invocation.
The plan is to eventually have additional execution modes:
In that last scenario, we'd at least potentially introduce support for per-function tiering, but that'd depend on strong use cases
As additional background, Lua doesn't have static types, so it's not possible to generate efficient code for it untl you've run it for a while and gathered data on what types it's using at runtime.
WebAssembly has static types, so it's possible to generate good native code for it without having to see it run first.
Last updated: Nov 22 2024 at 16:03 UTC