use criterion::{black_box, criterion_group, criterion_main, Criterion}; use ultraroute::command::Command; use ultraroute::create_command; fn create_command_bench(text: String) { create_command!(text); } fn criterion_benchmark(c: &mut Criterion) { c.bench_function("create_command no args", |b| { b.iter(|| create_command_bench(black_box(String::from("hello")))) }); c.bench_function("create_command with args", |b| { b.iter(|| create_command_bench(black_box(String::from("hello {} {}")))) }); } criterion_group!(benches, criterion_benchmark); criterion_main!(benches);