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