feat(runtime): cache compiled components

Enable Wasmtime's persistent compilation cache and expose an optional cache directory in RuntimeConfig.

Create and canonicalize the configured directory before Engine construction, and report cache filesystem and configuration failures through dedicated RuntimeError variants.
This commit is contained in:
Maofeng
2026-07-30 07:18:21 +08:00
parent 38a397fa20
commit 53a8c6b690
4 changed files with 132 additions and 21 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ toml = "0.9.8"
tower-http = { version = "0.7.0", features = ["cors", "trace"] }
tracing = "0.1.44"
tracing-subscriber = { version = "0.3.23", features = ["env-filter", "fmt"] }
wasmtime = { version = "=41.0.0", default-features = false, features = ["component-model", "cranelift", "runtime", "std"] }
wasmtime = { version = "=41.0.0", default-features = false, features = ["cache", "component-model", "cranelift", "runtime", "std"] }
wasmtime-wasi = { version = "=41.0.0", default-features = false, features = ["p2"] }
wit-bindgen = "=0.41.0"
wit-component = "=0.243.0"