Skip to main content

Module wasmtime

Module wasmtime 

Source
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_STRATEGYEffect
undefinedNo profiling
"jitdump"jitdump profiling
"perfmap"perfmap profiling
other valueNo profiling (warning)

Re-exports§

pub use crate::executor::common::runtime_blob::RuntimeBlob;
pub use crate::executor::common::wasm_runtime::HeapAllocStrategy;
pub use crate::executor::common::wasm_runtime::WasmModule;

Structs§

Config
DeterministicStackLimit
Knobs for deterministic stack height limiting.
Semantics
WasmtimeRuntime
A WasmModule implementation using wasmtime to compile the runtime module to machine code and execute the compiled code.

Enums§

InstantiationStrategy
The instantiation strategy to use for the WASM executor.

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 than create_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 than create_runtime, but slower than the more optimized create_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 calling create_runtime avoiding long compilation times.