-
Notifications
You must be signed in to change notification settings - Fork 822
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[runtime] Setup context data before instantiation or support closures #169
Comments
Hmm. I believe we'd be breaking the WebAssembly specification if we didn't automatically run the Would it be useful for your usecase if the runtime had explicit support for metering? It would likely have much less performance-impact than what you're doing now. |
Either way works for us. Supporting closures is cleaner, but as long as it doesn't affect performance.
That would be great. I think compute metering is the biggest overhead, because it requires context switching. Having it done by the runtime with some configuration that we can use would be huge perf boost. We can even receive it after entire execution if we could setup the limit beforehand. |
Currently, instance calls
start_func
automatically when created here https://github.com/wasmerio/wasmer/blob/master/lib/runtime-core/src/instance.rs#L69Before calling
start_func
, I want to be able to modifyCtx
by modifying.data
first. Would be nice to move it out of Instance::new().Context:
We are using gas meter injector that adds some runtime callback after every operation in wasm. I assume it also modifies start_func and inserts some gas meter calls there as well. Since ctx.data is null at this moment it fails with the following error:
CallError(Runtime(Unknown { msg: "trap at 0x40 - segmentation violation" }))
The text was updated successfully, but these errors were encountered: