Stream: wasmtime

Topic: Slow Module Compilation


view this post on Zulip Víctor García (Mar 29 2023 at 17:17):

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

The JS WASM Workers Runtime is a WebAssembly runtime that uses QuickJS as the JavaScript Engine. It is designed to be used in a Rust environment. - js-wasm-workers-runtime/lib.rs at main · gc-victo...

view this post on Zulip Notification Bot (Mar 29 2023 at 17:20):

A message was moved here from #wasmtime > WASI linkage (emscreepten) by Alex Crichton.

view this post on Zulip Alex Crichton (Mar 29 2023 at 17:21):

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?

view this post on Zulip Alex Crichton (Mar 29 2023 at 17:21):

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: Nov 22 2024 at 17:03 UTC