-
Notifications
You must be signed in to change notification settings - Fork 10
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(wasmtime) expose cache_config directive #536
Conversation
@thibaultcha the tests for cache enabled and disabled don't actually check that the cache was actually created (I don't know how to check for the existence of files at the end of a test within the Test::Nginx DSL), but if you run each of them with |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #536 +/- ##
===================================================
- Coverage 90.06471% 90.06261% -0.00210%
===================================================
Files 47 47
Lines 10045 10063 +18
===================================================
+ Hits 9047 9063 +16
- Misses 998 1000 +2
Flags with carried forward coverage won't be shown. Click here to find out more. |
Ultimately it's fine if all we test is our directive and its calling of the underlying wasmtime function. We aren't responsible for testing the behavior of the runtime itself, even though that's a plus if we can, but well... |
b852a14
to
70e7140
Compare
70e7140
to
9ef2ec5
Compare
9ef2ec5
to
852fdee
Compare
This adds support for `wasmtime { cache_config <config.toml>; }`, for enabling disk caching of ahead-of-time compilation of .wasm files. This should alleviate noticeable CPU spikes when starting up workers using Wasmtime and Wasm modules larger than a few megabytes.
852fdee
to
fa89090
Compare
#warn "\n", $file, "\n"; | ||
unlink($file); | ||
} | ||
}); |
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.
Do we need this in this file?
use t::TestWasmX; | ||
|
||
our $nginxV = $t::TestWasmX::nginxV; | ||
our $osname = $t::TestWasmX::osname; |
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.
Also looks unused
This adds support for
wasmtime { flag cache_config_load <config.toml>; }
, for enabling disk caching of ahead-of-time compilation of .wasm files.This should alleviate noticeable CPU spikes when starting up workers using Wasmtime and Wasm modules larger than a few megabytes.
Implementation notes:
cache_config_load
as documented in https://docs.wasmtime.dev/api/wasmtime/struct.Config.html#method.cache_config_load since that is the reference we point to in our documentation.