summaryrefslogtreecommitdiffstats
path: root/benches
diff options
context:
space:
mode:
authorCanop <cano.petrole@gmail.com>2021-03-09 17:08:01 +0100
committerCanop <cano.petrole@gmail.com>2021-03-09 17:08:01 +0100
commitdb01ddf065ec460d3e61b4c06933d312845973ee (patch)
treee77a30ba2f8c15d2a17b31b14b4e46e38706e57c /benches
parentd41c534bb43fbf23eecfcd6232300e3685df82d1 (diff)
add more tests to fuzzy benchmarking
Diffstat (limited to 'benches')
-rw-r--r--benches/fuzzy.rs18
1 files changed, 14 insertions, 4 deletions
diff --git a/benches/fuzzy.rs b/benches/fuzzy.rs
index cbbadf8..6f3a973 100644
--- a/benches/fuzzy.rs
+++ b/benches/fuzzy.rs
@@ -3,9 +3,7 @@ use {
criterion::{black_box, criterion_group, criterion_main, Criterion},
};
-static PATTERNS: &[&str] = &["réveil", "AB", "e", "brt"];
-// this list contains 100 names, which makes it easier to estimate the duration
-// of a pattern matching per file name.
+static PATTERNS: &[&str] = &["réveil", "AB", "e", "brt", "brootz"];
static NAMES: &[&str] = &[
" brr ooT",
"Réveillon",
@@ -73,6 +71,7 @@ static NAMES: &[&str] = &[
"la tortue géante",
"le chamois",
"dystroy",
+ "bra ernre rjrz a e3 broorar/ e/ smallvec/memmap;r b oot4 Z",
"un petit peu n'importe quoi",
"dans",
"cette",
@@ -107,10 +106,21 @@ static NAMES: &[&str] = &[
"is",
"the",
"author",
+ "bro o o o o o o o o o o o o ot",
+ "bro o o o o o o o o o o o o otz",
+ "br bro boo broot brootz",
+ "b b bb bb ca e 1234 oooot",
+ "Bo br BBBroo OOOOOt",
+ "kir ba lrbvr b rbaz broot",
+ "nrel ora hr rbooo t roo jrzz 7 tz",
+ "not matching anything, is it ?",
+ "ae/r/re /reee/ea",
+ "era",
+ "lrlb rre o",
+ "rjre nr",
];
fn score_of_benchmark(c: &mut Criterion) {
- assert_eq!(NAMES.len(), 100);
for pattern in PATTERNS {
let task = format!("FuzzyPattern({:?})::score_of", pattern);
c.bench_function(&task, |b| {