I'm using Module::from_binary and it seems that it is slow, or I'm doing something else that makes it slow. Any advice to speed it up or fix it?
https://github.com/gc-victor/js-wasm-workers-runtime/blob/main/crates/runtime/src/lib.rs#L42
A message was moved here from #wasmtime > WASI linkage (emscreepten) by Alex Crichton.
The Module::from_binary
API compiles the wasm module to native machine code, so if that's slow it's probably the compilation process that's slow. Would you be able to share the binary?
Glancing at the code there, looks like your WASM
is a static module that doesn't change, so I'd recommend compiling the module once at program startup so that way each request doesn't have to recompile the wasm
Last updated: Dec 23 2024 at 13:07 UTC