(c: &mut Criterion)
| 34 | } |
| 35 | |
| 36 | fn criterion_benchmark(c: &mut Criterion) { |
| 37 | let module = tinywasm_parse().expect("tinywasm_parse"); |
| 38 | let twasm = tinywasm_to_twasm(&module).expect("tinywasm_to_twasm"); |
| 39 | let mut group = c.benchmark_group("tinywasm"); |
| 40 | |
| 41 | group.measurement_time(std::time::Duration::from_secs(2)); |
| 42 | group.bench_function("tinywasm_parse", |b| b.iter(tinywasm_parse)); |
| 43 | group.bench_function("tinywasm_to_twasm", |b| b.iter(|| tinywasm_to_twasm(&module))); |
| 44 | group.bench_function("tinywasm_from_twasm", |b| b.iter(|| tinywasm_from_twasm(&twasm))); |
| 45 | group.measurement_time(std::time::Duration::from_secs(10)); |
| 46 | group.bench_function("tinywasm", |b| b.iter(|| tinywasm_run(&module))); |
| 47 | } |
| 48 | |
| 49 | criterion_group!(benches, criterion_benchmark); |
| 50 | criterion_main!(benches); |
nothing calls this directly
no test coverage detected