wasmtime: add options for configuring between winch and cranelift#562
Conversation
Signed-off-by: Matt Leon <mattleon@google.com>
Signed-off-by: Matt Leon <mattleon@google.com>
Signed-off-by: Matt Leon <mattleon@google.com>
Signed-off-by: Matt Leon <mattleon@google.com>
Winch is not supported on s390x Signed-off-by: Matt Leon <mattleon@google.com>
Signed-off-by: Matt Leon <mattleon@google.com>
PiotrSikora
left a comment
There was a problem hiding this comment.
Definitely +1 for adding winch, but:
- This is added as a configuration option, which doesn't match how other engine flavors are exposed in this library (e.g.
wamr-interp,wamr-jit,wamr-aot). - I'm not sure if the optimization levels have any meaningful impact, so they might be only adding unnecessary noise and maintenance burden. Do you have any benchmarks?
|
Indeed I do have benchmarks of the different opt levels: wasmtime with cranelift and kSpeedAndSize wasmtime with cranelift and kSpeed wasmtime with cranelift and kNone wasmtime with winch Notably, the CompiledSizeB is the primary difference between the opt levels. I did not see a difference between kSpeedAndSize and kSpeed, which indicates they might be effectively the same. Would you prefer that we default to the highest opt level for cranelift, and provide only winch as the lighter option? |
|
Re: winch as a different compilation target: Winch is already included in the cranelift build, as it simply uses cranelift_codegen without any intermediate representation or optimization passes. It's also offered upstream as a runtime config option (though you can avoid compiling certain features if you don't want them). With the addition of the proxy_wasm::WasmVm::serialize API, it is very appealing for us to be able to instantiate a Wasmtime WasmVm with cranelift for in-process AOT compilation, but use a WasmVm with Winch for its potentially significantly faster load time when performing a cold start. |
Signed-off-by: Matt Leon <mattleon@google.com>
|
Random though, but perhaps we should default (or maybe even hardcode?) to Winch for |
Signed-off-by: Matt Leon <mattleon@google.com>
Winch has significantly faster load times than cranelift, with negligible difference in runtime performance:
With this change, we will be ready to switch Envoy over to using Wasmtime with Winch by default.