-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1698: Fix benchmarks r=pksunkara a=CreepySkeleton Co-authored-by: CreepySkeleton <creepy-skeleton@yandex.ru>
- Loading branch information
Showing
8 changed files
with
637 additions
and
645 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
#![feature(test)] | ||
|
||
use clap::App; | ||
use test::Bencher; | ||
use criterion::{criterion_group, criterion_main, Criterion}; | ||
|
||
#[bench] | ||
fn build_app(b: &mut Bencher) { | ||
b.iter(|| App::new("claptests")); | ||
pub fn empty_app(c: &mut Criterion) { | ||
c.bench_function("build_app", |b| b.iter(|| App::new("claptests"))); | ||
} | ||
|
||
#[bench] | ||
fn parse_clean(b: &mut Bencher) { | ||
b.iter(|| App::new("claptests").get_matches_from(vec![""])); | ||
pub fn parse_clean(c: &mut Criterion) { | ||
c.bench_function("parse_clean", |b| { | ||
b.iter(|| App::new("claptests").get_matches_from(vec![""])) | ||
}); | ||
} | ||
|
||
criterion_group!(benches, empty_app, parse_clean); | ||
criterion_main!(benches); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.