mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-27 07:14:26 +01:00
52 lines
1.3 KiB
Rust
52 lines
1.3 KiB
Rust
|
mod utils;
|
||
|
|
||
|
use criterion::{criterion_group, criterion_main};
|
||
|
|
||
|
fn bench_normal(c: &mut criterion::Criterion) {
|
||
|
let confs = &[
|
||
|
utils::Conf {
|
||
|
group_name: "basic placeholder",
|
||
|
queries: &[
|
||
|
"",
|
||
|
],
|
||
|
..utils::Conf::BASE
|
||
|
},
|
||
|
utils::Conf {
|
||
|
group_name: "basic without quote",
|
||
|
queries: &[
|
||
|
"david bowie", // 1200
|
||
|
"michael jackson", // 600
|
||
|
"marcus miller", // 60
|
||
|
"Notstandskomitee", // 4
|
||
|
],
|
||
|
..utils::Conf::BASE
|
||
|
},
|
||
|
utils::Conf {
|
||
|
group_name: "basic with quote",
|
||
|
queries: &[
|
||
|
"\"david\" \"bowie\"", // 1200
|
||
|
"\"michael\" \"jackson\"", // 600
|
||
|
"\"marcus\" \"miller\"", // 60
|
||
|
"\"Notstandskomitee\"", // 4
|
||
|
],
|
||
|
..utils::Conf::BASE
|
||
|
},
|
||
|
utils::Conf {
|
||
|
group_name: "prefix search",
|
||
|
queries: &[
|
||
|
"s", // 500k+ results
|
||
|
"a",
|
||
|
"b",
|
||
|
"i",
|
||
|
"x", // only 7k results
|
||
|
],
|
||
|
..utils::Conf::BASE
|
||
|
},
|
||
|
];
|
||
|
|
||
|
utils::run_benches(c, confs);
|
||
|
}
|
||
|
|
||
|
criterion_group!(benches, bench_normal);
|
||
|
criterion_main!(benches);
|