Skip to content

Commit

Permalink
Revamp Args from the ground-up (#326)
Browse files Browse the repository at this point in the history
  • Loading branch information
arqunis authored Jun 4, 2018
1 parent a80aab2 commit ff9edc0
Show file tree
Hide file tree
Showing 3 changed files with 377 additions and 315 deletions.
50 changes: 0 additions & 50 deletions benches/bench_args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,56 +48,6 @@ mod benches {
})
}

#[bench]
fn len_with_one_delimiter(b: &mut Bencher) {
b.iter(|| {
let mut args = Args::new("1,2,3,4,5,6,7,8,9,10,11,12,13,14", &[",".to_string()]);
args.len();
})
}

#[bench]
fn double_len_with_one_delimiter(b: &mut Bencher) {
b.iter(|| {
let mut args = Args::new("1,2,3,4,5,6,7,8,9,10,11,12,13,14", &[",".to_string()]);
args.len();
args.len();
})
}

#[bench]
fn double_len_quoted_with_one_delimiter(b: &mut Bencher) {
b.iter(|| {
let mut args = Args::new(r#""a" "a" "a" "a" "a" "a" "a" "a" "a" "a""#, &[" ".to_string()]);
args.len_quoted();
args.len_quoted();
})
}

#[bench]
fn len_with_three_delimiter(b: &mut Bencher) {
b.iter(|| {
let mut args = Args::new("1,2,3,4@5,6,7@8,9,10@11,12#13,14", &[",".to_string(), "@".to_string(), "#".to_string()]);
args.len();
})
}

#[bench]
fn len_quoted_with_one_delimiter(b: &mut Bencher) {
b.iter(|| {
let mut args = Args::new(r#""1","2","3","4","5","6","7","8","9","10""#, &[",".to_string()]);
args.len();
})
}

#[bench]
fn len_quoted_with_three_delimiter(b: &mut Bencher) {
b.iter(|| {
let mut args = Args::new(r#""1"-"2"<"3","4","5","6","7"<"8","9"<"10""#, &[",".to_string(), "-".to_string(), "<".to_string()]);
args.len();
})
}

#[bench]
fn multiple_with_one_delimiter(b: &mut Bencher) {
b.iter(|| {
Expand Down
Loading

0 comments on commit ff9edc0

Please sign in to comment.