mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-26 12:05:05 +08:00
Fix the benchmarks
This commit is contained in:
parent
6d52c5b2f0
commit
082ad84914
@ -11,14 +11,10 @@ fn bench_search(c: &mut criterion::Criterion) {
|
|||||||
"minogue kylie live",
|
"minogue kylie live",
|
||||||
];
|
];
|
||||||
|
|
||||||
std::fs::create_dir_all(database).unwrap();
|
let mut options = EnvOpenOptions::new();
|
||||||
let env = EnvOpenOptions::new()
|
options.map_size(100 * 1024 * 1024 * 1024); // 100 GB
|
||||||
.map_size(100 * 1024 * 1024 * 1024) // 100 GB
|
options.max_readers(10);
|
||||||
.max_readers(10)
|
let index = Index::new(options, database).unwrap();
|
||||||
.max_dbs(5)
|
|
||||||
.open(database).unwrap();
|
|
||||||
|
|
||||||
let index = Index::new(&env).unwrap();
|
|
||||||
|
|
||||||
let mut group = c.benchmark_group("search");
|
let mut group = c.benchmark_group("search");
|
||||||
group.sample_size(10);
|
group.sample_size(10);
|
||||||
@ -27,13 +23,12 @@ fn bench_search(c: &mut criterion::Criterion) {
|
|||||||
for query in &queries {
|
for query in &queries {
|
||||||
group.bench_with_input(BenchmarkId::from_parameter(query), &query, |b, &query| {
|
group.bench_with_input(BenchmarkId::from_parameter(query), &query, |b, &query| {
|
||||||
b.iter(|| {
|
b.iter(|| {
|
||||||
let rtxn = env.read_txn().unwrap();
|
let rtxn = index.read_txn().unwrap();
|
||||||
let _documents_ids = index.search(&rtxn).query(*query).execute().unwrap();
|
let _documents_ids = index.search(&rtxn).query(*query).execute().unwrap();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
group.finish();
|
group.finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user