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

Function criterion_benchmark

crates/tinywasm/benches/argon2id.rs:32–44  ·  view source on GitHub ↗
(c: &mut Criterion)

Source from the content-addressed store, hash-verified

30}
31
32fn 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
46criterion_group!(benches, criterion_benchmark);
47criterion_main!(benches);

Callers

nothing calls this directly

Calls 4

argon2id_parseFunction · 0.85
argon2id_to_twasmFunction · 0.85
argon2id_from_twasmFunction · 0.85
argon2id_runFunction · 0.85

Tested by

no test coverage detected