Introduce benchmarking API
The new crate introduced here, `wasmtime-bench-api`, creates a shared library, e.g. `wasmtime_bench_api.so`, for executing Wasm benchmarks using Wasmtime. It allows us to measure several phases separately by exposing `engine_compile_module`, `engine_instantiate_module`, and `engine_execute_module`, which pass around an opaque pointer to the internally initialized state. This state is initialized and freed by `engine_create` and `engine_free`, respectively. The API also introduces a way of passing in functions to satisfy the `"bench" "start"` and `"bench" "end"` symbols that we expect Wasm benchmarks to import. The API is exposed in a C-compatible way so that we can dynamically load it (carefully) in our benchmark runner.
This commit is contained in:
@@ -64,6 +64,7 @@ opt-level = 0
|
||||
[workspace]
|
||||
members = [
|
||||
"cranelift",
|
||||
"crates/bench-api",
|
||||
"crates/c-api",
|
||||
"crates/fuzzing",
|
||||
"crates/misc/run-examples",
|
||||
|
||||
Reference in New Issue
Block a user