Commit Graph

6 Commits

Author SHA1 Message Date
Pat Hickey
d5fdd835ab port bench-api 2021-01-29 13:25:06 -08:00
Nick Fitzgerald
d1c1cb6a25 bench-api: receive working directory as an argument
Rather than implicitly use the current working directory.
2021-01-28 11:43:06 -08:00
Nick Fitzgerald
8d84482153 bench-api: Allow access to files in the current directory
And pass through the `WASM_BENCH_USE_SMALL_WORKLOAD` env var.

Part of https://github.com/bytecodealliance/sightglass/issues/70
2021-01-26 09:43:53 -08:00
Nick Fitzgerald
bc6dc083f0 wasmtime-bench-api: Randomize the locations of heap objects
This helps us avoid measurement bias due to accidental locality of unrelated
heap objects. See *Stabilizer: Statistically Sound Performance Evaluation* by
Curtsinger and Berger for details (although Stabilizer deals with much more than
just the location of heap allocations):
https://people.cs.umass.edu/~emery/pubs/stabilizer-asplos13.pdf
2021-01-12 15:43:26 -08:00
Nick Fitzgerald
cc81570a05 bench-api: Clean up the benchmarking API
Mostly just tweaks to docs/naming/readability/tidying up.

The biggest thing is that the wasm bytes are passed in during compilation now,
rather than on initialization, which lets us remove the lifetime from our state
struct and makes wrangling unsafe conversions that much easier.
2020-12-15 11:21:51 -08:00
Andrew Brown
41d668b4da 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.
2020-12-10 15:02:10 -08:00