This benchmark spawns a new thread, and records the duration to eagerly initializes the thread local resources. It then creates a store and instance, and records the duration it took to execute the first function call.
(engine: Engine, module: Module)
| 73 | /// instance, and records the duration it took to execute the first function |
| 74 | /// call. |
| 75 | fn eager_thread_instantiate(engine: Engine, module: Module) -> (Duration, Duration) { |
| 76 | thread::spawn(move || { |
| 77 | let init_start = Instant::now(); |
| 78 | Engine::tls_eager_initialize(); |
| 79 | let init_duration = init_start.elapsed(); |
| 80 | |
| 81 | (init_duration, duration_of_call(&engine, &module)) |
| 82 | }) |
| 83 | .join() |
| 84 | .expect("thread joins") |
| 85 | } |
| 86 | |
| 87 | fn test_setup() -> (Engine, Module) { |
| 88 | // We only expect to create one Instance at a time, with a single memory. |
no test coverage detected