Expand description
Defines a WasmRuntime
that uses the Wasmtime JIT to execute.
You can choose a profiling strategy at runtime with
environment variable WASMTIME_PROFILING_STRATEGY
:
WASMTIME_PROFILING_STRATEGY | Effect |
---|---|
undefined | No profiling |
"jitdump" | jitdump profiling |
other value | No profiling (warning) |
Structs§
- Config
- Deterministic
Stack Limit - Knobs for deterministic stack height limiting.
- Runtime
Blob - A program blob containing a Substrate runtime.
- Semantics
- Wasmtime
Runtime - A
WasmModule
implementation using wasmtime to compile the runtime module to machine code and execute the compiled code.
Enums§
- Heap
Alloc Strategy - Defines the heap pages allocation strategy the wasm runtime should use.
- Instantiation
Strategy - The instantiation strategy to use for the WASM executor.
Traits§
- Wasm
Module - A trait that defines an abstract WASM runtime module.
Functions§
- create_
runtime - Create a new
WasmtimeRuntime
given the code. This function performs translation from Wasm to machine code, which can be computationally heavy. - create_
runtime_ ⚠from_ artifact - The same as
create_runtime
but takes a path to a precompiled artifact, which makes this function considerably faster thancreate_runtime
. - create_
runtime_ ⚠from_ artifact_ bytes - The same as
create_runtime
but takes the bytes of a precompiled artifact, which makes this function considerably faster thancreate_runtime
, but slower than the more optimizedcreate_runtime_from_artifact
. This is especially slow on non-Linux Unix systems. Useful in very niche cases. - prepare_
runtime_ artifact - Takes a
RuntimeBlob
and precompiles it returning the serialized result of compilation. It can then be used for callingcreate_runtime
avoiding long compilation times.