clap/benches/01_default.rs

16 lines
435 B
Rust
Raw Normal View History

2015-09-01 11:00:51 -05:00
use clap::App;
2020-02-17 21:14:19 +03:00
use criterion::{criterion_group, criterion_main, Criterion};
2015-09-01 11:00:51 -05:00
2020-03-05 10:06:17 +01:00
pub fn build_empty(c: &mut Criterion) {
c.bench_function("build_empty", |b| b.iter(|| App::new("claptests")));
2020-01-31 10:13:44 +01:00
}
2015-09-01 11:00:51 -05:00
2020-03-05 10:06:17 +01:00
pub fn parse_empty(c: &mut Criterion) {
c.bench_function("parse_empty", |b| {
2020-02-21 03:12:28 +03:00
b.iter(|| App::new("claptests").get_matches_from(vec![""]))
});
2020-01-31 10:13:44 +01:00
}
2020-02-17 21:14:19 +03:00
2020-03-05 10:06:17 +01:00
criterion_group!(benches, build_empty, parse_empty);
2020-02-17 21:14:19 +03:00
criterion_main!(benches);