Switch to pooling copy-on-write instantiation strategy for WASM (#11232)

* Switch to pooling copy-on-write instantiation strategy for WASM

* Fix benchmark compilation

* Fix `cargo fmt`

* Fix compilation of another benchmark I've missed

* Cleanups according to review comments

* Move `max_memory_size` to `Semantics`

* Set `memory_guaranteed_dense_image_size` to `max_memory_size`

* Rename `wasm_instantiation_strategy` to `wasmtime_instantiation_strategy`

* Update the doc-comments regarding the instantiation strategy

* Extend the integration tests to test every instantiation strategy

* Don't drop the temporary directory until the runtime is dropped in benchmarks

* Don't drop the temporary directory until the runtime is dropped in tests
This commit is contained in:
Koute
2022-05-19 16:32:53 +09:00
committed by GitHub
parent b3b7b4ddc7
commit dd854c16e2
21 changed files with 726 additions and 236 deletions
+13
View File
@@ -4173,6 +4173,15 @@ version = "2.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a"
[[package]]
name = "memfd"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f6627dc657574b49d6ad27105ed671822be56e0d2547d413bfbf3e8d8fa92e7a"
dependencies = [
"libc",
]
[[package]]
name = "memmap"
version = "0.7.0"
@@ -8197,6 +8206,7 @@ dependencies = [
"hex-literal",
"lazy_static",
"lru",
"num_cpus",
"parity-scale-codec",
"parking_lot 0.12.0",
"paste 1.0.6",
@@ -8221,6 +8231,7 @@ dependencies = [
"sp-version",
"sp-wasm-interface",
"substrate-test-runtime",
"tempfile",
"tracing",
"tracing-subscriber",
"wasmi",
@@ -8274,6 +8285,7 @@ dependencies = [
"sp-runtime-interface",
"sp-sandbox",
"sp-wasm-interface",
"tempfile",
"wasmtime",
"wat",
]
@@ -11838,6 +11850,7 @@ dependencies = [
"libc",
"log",
"mach",
"memfd",
"memoffset",
"more-asserts",
"rand 0.8.4",