Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Commit

Permalink
bench done
Browse files Browse the repository at this point in the history
  • Loading branch information
tamuhey committed Apr 1, 2021
1 parent bcf8a55 commit c298150
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
7 changes: 5 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ documentation = "https://docs.rs/tokenizations"

[dependencies]
unicode-normalization = "0.1.8"
seqdiff = "0.2"
seqdiff = "0.3"

[dev-dependencies]
quickcheck = "0.9"
Expand All @@ -25,4 +25,7 @@ name = "main"
harness = false

[lib]
bench = false
bench = false

[profile.bench]
debug = 2
12 changes: 3 additions & 9 deletions benches/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,10 @@ fn get_alignments(c: &mut Criterion) {
"ppppppppppppppp",
]);

// short
group.bench_function("handmade short", |b| {
b.iter(|| tokenizations::get_alignments(&s, &t))
});

// long
let n = black_box(100);
let s_long = s.repeat(n);
let t_long = t.repeat(n);
Expand All @@ -42,23 +40,19 @@ fn get_alignments(c: &mut Criterion) {
b.iter(|| tokenizations::get_alignments(&s_long, &t_long))
});

// identical short
group.bench_function("identical short", |b| {
b.iter(|| tokenizations::get_alignments(&s, &s))
});

// identical long
group.bench_function("identical short", |b| {
group.bench_function("identical long", |b| {
b.iter(|| tokenizations::get_alignments(&s_long, &s_long))
});

// completely different short
group.bench_function("completery different short", |b| {
group.bench_function("completely different short", |b| {
b.iter(|| tokenizations::get_alignments(&s, &u))
});

// completely different long
group.bench_function("completery different long", |b| {
group.bench_function("completely different long", |b| {
b.iter(|| tokenizations::get_alignments(&s_long, &u_long))
});
group.finish()
Expand Down

0 comments on commit c298150

Please sign in to comment.