Minor instantiation benchmark updates (#3790)

This commit has a few minor updates and some improvements to the
instantiation benchmark harness:

* A `once_cell::unsync::Lazy` type is now used to guard creation of
  modules/engines/etc. This enables running singular benchmarks to be
  much faster since the benchmark no longer compiles all other
  benchmarks that are filtered out. Unfortunately I couldn't find a way
  in criterion to test whether a `BenchmarkId` is filtered out or not so
  we rely on the runtime laziness to initialize on the first run for
  benchmarks that do so.

* All files located in `benches/instantiation` are now loaded for
  benchmarking instead of a hardcoded list. This makes it a bit easier
  to throw files into the directory and have them benchmarked instead of
  having to recompile when working with new files.

* Finally a module deserialization benchmark was added to measure the
  time it takes to deserialize a precompiled module from disk (inspired
  by discussion on #3787)

While I was at it I also upped some limits to be able to instantiate
cfallin's `spidermonkey.wasm`.
This commit is contained in:
Alex Crichton
2022-02-10 15:40:30 -06:00
committed by GitHub
parent 520a7f26d7
commit 1cb08d4e67
3 changed files with 120 additions and 97 deletions

1
Cargo.lock generated
View File

@@ -3496,6 +3496,7 @@ dependencies = [
"memchr",
"more-asserts",
"num_cpus",
"once_cell",
"pretty_env_logger",
"rayon",
"rustix",