When wasmtime first runs a function on a thread, it needs to initialize some thread-local resources and install signal handlers. This benchmark spawns a new thread, and returns the duration it took to execute the first function call made on that thread.
(engine: Engine, module: Module)
| 64 | /// spawns a new thread, and returns the duration it took to execute the first |
| 65 | /// function call made on that thread. |
| 66 | fn lazy_thread_instantiate(engine: Engine, module: Module) -> Duration { |
| 67 | thread::spawn(move || duration_of_call(&engine, &module)) |
| 68 | .join() |
| 69 | .expect("thread joins") |
| 70 | } |
| 71 | /// This benchmark spawns a new thread, and records the duration to eagerly |
| 72 | /// initializes the thread local resources. It then creates a store and |
| 73 | /// instance, and records the duration it took to execute the first function |
no test coverage detected