Can the Engine be cloned + reused across calls to the same WASM code? #2636
Unanswered
emschwartz
asked this question in
Q&A
Replies: 1 comment
-
I am also looking for this. I am trying to run many wasm instances in the same process, and they all uses the same code. So, ideally, the modules can be precompiled and instance is only associated with the store for saving per-instance data. This will save a ton of memory, for example, a Wasi binary can easily go to 300k, while it might only use very little to run. I know wasmtime support this, which is what I am using, but they are lacking way too many features that I need, such as networking. wasmer is great, but it doesn't seem to have this support from the instance creation code. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am using wasmer to run user request handlers that are compiled to wasm. Each invocation must be totally separate and cannot leak data between calls. However, I would like to do as much pre-processing as possible to make the request handlers as fast as possible.
Is it possible to clone the Engine with the compiled wasm already loaded without copying the program's state? Or is there another way to cut down on the amount of work that needs to be done to handle a single request? (Or am I thinking about this the wrong way and is there not actually that much work that needs to be done to go from the wasm_module bytes to a runnable wasmer runtime instance?)
Right now, I am loading the wasm files into memory as
Vec<u8>
's and running the following code to handle each user request:Beta Was this translation helpful? Give feedback.
All reactions