(c: &mut Criterion)
| 30 | } |
| 31 | |
| 32 | fn criterion_benchmark(c: &mut Criterion) { |
| 33 | let module = argon2id_parse().expect("argon2id_parse"); |
| 34 | let twasm = argon2id_to_twasm(&module).expect("argon2id_to_twasm"); |
| 35 | let mut group = c.benchmark_group("argon2id"); |
| 36 | |
| 37 | group.measurement_time(std::time::Duration::from_secs(2)); |
| 38 | group.bench_function("argon2id_parse", |b| b.iter(argon2id_parse)); |
| 39 | group.bench_function("argon2id_to_twasm", |b| b.iter(|| argon2id_to_twasm(&module))); |
| 40 | group.bench_function("argon2id_from_twasm", |b| b.iter(|| argon2id_from_twasm(&twasm))); |
| 41 | |
| 42 | group.measurement_time(std::time::Duration::from_secs(10)); |
| 43 | group.bench_function("argon2id", |b| b.iter(|| argon2id_run(module.clone()))); |
| 44 | } |
| 45 | |
| 46 | criterion_group!(benches, criterion_benchmark); |
| 47 | criterion_main!(benches); |
nothing calls this directly
no test coverage detected