Implement simple benchmarks for instantiation.

This adds benchmarks around module instantiation using criterion.

Both the default (i.e. on-demand) and pooling allocators are tested
sequentially and in parallel using a thread pool.

Instantiation is tested with an empty module, a module with a single page
linear memory, a larger linear memory with a data initializer, and a "hello
world" Rust WASI program.
This commit is contained in:
Peter Huene
2021-05-11 01:00:34 -07:00
parent fa1faf5d22
commit 1b8efa7bbd
10 changed files with 197 additions and 5 deletions

View File

@@ -363,6 +363,19 @@ jobs:
env:
RUST_BACKTRACE: 1
bench:
name: Run benchmarks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- run: rustup target add wasm32-wasi
- name: Install Rust
run: rustup update stable && rustup default stable
- run: cargo bench
- run: cargo bench --features uffd
# Verify that cranelift's code generation is deterministic
meta_determinist_check:
name: Meta deterministic check