From c298150fa34d3694fc43429f80d68efbae62ff3b Mon Sep 17 00:00:00 2001 From: Yohei Tamura Date: Wed, 31 Mar 2021 21:10:20 +0900 Subject: [PATCH] bench done --- Cargo.toml | 7 +++++-- benches/main.rs | 12 +++--------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f976dcb..8deeb95 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" @@ -25,4 +25,7 @@ name = "main" harness = false [lib] -bench = false \ No newline at end of file +bench = false + +[profile.bench] +debug = 2 diff --git a/benches/main.rs b/benches/main.rs index 60cfdec..8d0c025 100644 --- a/benches/main.rs +++ b/benches/main.rs @@ -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); @@ -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()