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
Externalize compilation cache by compilers #747
Conversation
@@ -50,11 +52,39 @@ func BenchmarkInitialization(b *testing.B) { | |||
} | |||
} | |||
|
|||
func runInitializationBench(b *testing.B, r wazero.Runtime) { | |||
func BenchmarkCompilation(b *testing.B) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Result:
BenchmarkCompilation
BenchmarkCompilation/with_extern_cache
BenchmarkCompilation/with_extern_cache-10 2008 526860 ns/op
BenchmarkCompilation/without_extern_cache
BenchmarkCompilation/without_extern_cache-10 165 7080493 ns/op
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unleashing comments to allow you to drift things while I read the rest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
more comments
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
Co-authored-by: Crypt Keeper <64215+codefromthecrypt@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think exposing this as an experimental hook simply with a dir is a great way to start. There's some more polishing to do on internal code, but this can allow users to start giving feedback meanwhile.
Co-authored-by: Crypt Keeper <64215+codefromthecrypt@users.noreply.github.com>
This adds the experimental support of the file system compilation cache.
Notably,
experimental.WithCompilationCacheDirName
allows users to configurewhere the compiler writes the cache into.
Versioning/validation of binary compatibility has been done via the release tag
(which will be created from the end of this month). More specifically, the cache
file starts with header with the hardcoded wazero version.
Note the cache implementation doesn't do any security mitigation like signing/verification,
and that would be a future TODO once we reach some stability.
The end-to-end test will be added in a subsequent PR.
Fixes #618