mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-27 04:25:06 +08: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_SONGS
|
|
},
|
|
utils::Conf {
|
|
group_name: "basic without quote",
|
|
queries: &[
|
|
"david bowie", // 1200
|
|
"michael jackson", // 600
|
|
"marcus miller", // 60
|
|
"Notstandskomitee", // 4
|
|
],
|
|
..utils::Conf::BASE_SONGS
|
|
},
|
|
utils::Conf {
|
|
group_name: "basic with quote",
|
|
queries: &[
|
|
"\"david\" \"bowie\"", // 1200
|
|
"\"michael\" \"jackson\"", // 600
|
|
"\"marcus\" \"miller\"", // 60
|
|
"\"Notstandskomitee\"", // 4
|
|
],
|
|
..utils::Conf::BASE_SONGS
|
|
},
|
|
utils::Conf {
|
|
group_name: "prefix search",
|
|
queries: &[
|
|
"s", // 500k+ results
|
|
"a",
|
|
"b",
|
|
"i",
|
|
"x", // only 7k results
|
|
],
|
|
..utils::Conf::BASE_SONGS
|
|
},
|
|
];
|
|
|
|
utils::run_benches(c, confs);
|
|
}
|
|
|
|
criterion_group!(benches, bench_normal);
|
|
criterion_main!(benches);
|