mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-09-14 08:46:26 +00:00
push a first version of the benchmark for the typo
This commit is contained in:
41
milli/benches/typo.rs
Normal file
41
milli/benches/typo.rs
Normal file
@ -0,0 +1,41 @@
|
||||
mod utils;
|
||||
|
||||
use std::time::Duration;
|
||||
use criterion::{criterion_group, criterion_main, BenchmarkId};
|
||||
|
||||
fn bench_typo(c: &mut criterion::Criterion) {
|
||||
let index = utils::base_setup(Some(vec!["typo".to_string()]));
|
||||
|
||||
let queries = [
|
||||
"mongus ",
|
||||
"thelonius monk ",
|
||||
"Disnaylande ",
|
||||
"the white striper ",
|
||||
"indochie ",
|
||||
"indochien ",
|
||||
"klub des loopers ",
|
||||
"fear of the duck ",
|
||||
"michel depech ",
|
||||
"stromal ",
|
||||
"dire straights ",
|
||||
"Arethla Franklin ",
|
||||
];
|
||||
|
||||
let mut group = c.benchmark_group("typo");
|
||||
group.sample_size(10);
|
||||
group.measurement_time(Duration::from_secs(12));
|
||||
|
||||
for query in &queries {
|
||||
group.bench_with_input(BenchmarkId::from_parameter(query), &query, |b, &query| {
|
||||
b.iter(|| {
|
||||
let rtxn = index.read_txn().unwrap();
|
||||
let _documents_ids = index.search(&rtxn).query(*query).execute().unwrap();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
group.finish();
|
||||
}
|
||||
|
||||
criterion_group!(benches, bench_typo);
|
||||
criterion_main!(benches);
|
Reference in New Issue
Block a user