MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / lazy_thread_instantiate

Function lazy_thread_instantiate

benches/thread_eager_init.rs:66–70  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

64/// spawns a new thread, and returns the duration it took to execute the first
65/// function call made on that thread.
66fn 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

Callers 1

measure_execution_timeFunction · 0.85

Calls 4

spawnFunction · 0.85
duration_of_callFunction · 0.85
expectMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected