Introduces the new optimizing compiler (wazevo) in experimental pkg #1869
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This finally closes #1496 which aims to introduce an optimizing compiler in wazero as
an alternative backend for the current single pass compiler.
Even though this is released under experimental, it already has been well-tested with
long-running fuzzing, Zig/TinyGo standard library tests etc.
It's only available yet on arm64, but we will soon start working on amd64 as well led by @evacchi.
The optimizing compiler is written entirely from scratch, and the initial result is pretty amazing.
The rough numbers on the performance aspect is like 2x faster on compilation and
3x faster on runtime compared to the existing single passs compiler when running
Zig's standard library tests which is a huge Wasm binary with all tests.
This is a huge win given that this new back end, even though it is "optimizing", but the implementation
is pretty naive currently, and there's huge room for improvements (we welcome contributions!).
Once amd64 is implemented and it's been adopted by communities, then this will be the default
compiler and we will delete the existing single pass is the plan for now.
You can enable the optimizing compiler by replacing
wazero.NewRuntimeConfigCompiler()
orwazero.NewRuntimeConfig()
with the new API likeIn CLI, you can use
-optimizing-compiler
flag to enable it:Thank you for all your support!