-
Notifications
You must be signed in to change notification settings - Fork 9
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
feat: compilation cache #43
Conversation
Great work! I'm curious what the lift would be pre 1.0 to actually change the SDK API to make it so we don't actually expose any wazero functions or package info -- instead we add some configuration functions to our API that set thing in wazero. Just as we don't expose anything wasmtime related in the Rust SDK.. if it's a massive change that would also be good to know. |
@nilslice Currently we are exposing these wazero APIs:
It all comes down to how many of these we want to implement for 1.0, maybe we can start with a minimal number of these implemented and then add them as people ask for them. I think I can squeeze these in before December 4th:
Let me know if there is anything else you think is important |
…eXX (#44) Currently we are exposing these wazero APIs: - [`RuntimeConfig`](https://github.com/tetratelabs/wazero/blob/d39d84505ad8021b5ba47bbc9dd55911b9b0406f/config.go#L40-L171) - [`ModuleConfig`](https://github.com/tetratelabs/wazero/blob/d39d84505ad8021b5ba47bbc9dd55911b9b0406f/config.go#L444-L638) - [`api.ValueType`](https://github.com/tetratelabs/wazero/blob/d39d84505ad8021b5ba47bbc9dd55911b9b0406f/api/wasm.go#L83-L110) - [`api.EncodeXX/api.DecodeXX`](https://github.com/tetratelabs/wazero/blob/d39d84505ad8021b5ba47bbc9dd55911b9b0406f/api/wasm.go#L693-L755) - [`api.Memory`](https://github.com/tetratelabs/wazero/blob/d39d84505ad8021b5ba47bbc9dd55911b9b0406f/api/wasm.go#L557-L673) The idea of this PR is hide away wazero from normal usage. If the user doesn't need any advanced configuration or functionality, then they shouldn't have to know about Wazero. That's why we are abstracting away `api.EncodeXX/api.DecodeXX` and `api.ValueType` since they will be used whenever you write a host function. `RuntimeConfig` and `ModuleConfig` are about giving the user fine grain control of the underyling configurations. We expose some of the functionality as part of the manifest as well, [see this for a more detailed breakdown](#43 (comment)). And `api.Memory` is for write-through access of the underyling memory. The only thing I am a bit worried about is [`RuntimeConfig.WithCloseOnContextDone`](https://github.com/tetratelabs/wazero/blob/5796897f37852bf2042cd63959ce4ff673c4366e/config.go#L170C2-L170C24) because by default wazero sets it to false, which might be very confusing. We do set it to true if the user configures a timeout though.
This PR is related to extism/extism#605
Without using compilation cache: 3ms
with compilation cache: 0.5ms
Since we're already exposing
wazero.RuntimeConfig
, I think we just need to mention it in the README