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-04 18:31:18 +00:00
|
|
|
pub fn build_empty_app(c: &mut Criterion) {
|
|
|
|
c.bench_function("build_empty_app", |b| b.iter(|| App::new("claptests")));
|
2020-01-31 09:13:44 +00:00
|
|
|
}
|
2015-09-01 16:00:51 +00:00
|
|
|
|
2020-03-04 18:31:18 +00:00
|
|
|
pub fn parse_empty_app(c: &mut Criterion) {
|
|
|
|
c.bench_function("parse_empty_app", |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-04 18:31:18 +00:00
|
|
|
criterion_group!(benches, build_empty_app, parse_empty_app);
|
2020-02-17 18:14:19 +00:00
|
|
|
criterion_main!(benches);
|