summaryrefslogtreecommitdiffstats
path: root/third_party/rust/clap/benches/01_default.rs
blob: 620b32b818fb810985c3793cde6016aab4673fe3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use clap::Command;
use criterion::{criterion_group, criterion_main, Criterion};

pub fn build_empty(c: &mut Criterion) {
    c.bench_function("build_empty", |b| b.iter(|| Command::new("claptests")));
}

pub fn parse_empty(c: &mut Criterion) {
    c.bench_function("parse_empty", |b| {
        b.iter(|| Command::new("claptests").get_matches_from(vec![""]))
    });
}

criterion_group!(benches, build_empty, parse_empty);
criterion_main!(benches);