MCPcopy Create free account
hub / github.com/explodingcamera/tinywasm / fibonacci_run

Function fibonacci_run

crates/tinywasm/benches/fibonacci.rs:23–35  ·  view source on GitHub ↗
(module: Module, recursive: bool, n: i32)

Source from the content-addressed store, hash-verified

21}
22
23fn fibonacci_run(module: Module, recursive: bool, n: i32) -> Result<()> {
24 let mut store = Store::default();
25 let instance = ModuleInstance::instantiate(&mut store, &module, None)?;
26 let argon2 = instance.func::<i32, i32>(
27 &store,
28 match recursive {
29 true => "fibonacci_recursive",
30 false => "fibonacci",
31 },
32 )?;
33 argon2.call(&mut store, n)?;
34 Ok(())
35}
36
37fn criterion_benchmark(c: &mut Criterion) {
38 let module = fibonacci_parse().expect("fibonacci_parse");

Callers 1

criterion_benchmarkFunction · 0.85

Calls 1

callMethod · 0.80

Tested by

no test coverage detected