Closed hishamhm closed 4 months ago
@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 -- ONLY
you can see that one of them creates the cache in the temporary dir and the other one doesn't.
Merging #536 (fa89090) into main (bb139e1) will decrease coverage by
0.00210%
. Report is 2 commits behind head on main. The diff coverage is89.47368%
.
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...
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.