mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-26 23:04:26 +01: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",
|
||||
];
|
||||
|
||||
std::fs::create_dir_all(database).unwrap();
|
||||
let env = EnvOpenOptions::new()
|
||||
.map_size(100 * 1024 * 1024 * 1024) // 100 GB
|
||||
.max_readers(10)
|
||||
.max_dbs(5)
|
||||
.open(database).unwrap();
|
||||
|
||||
let index = Index::new(&env).unwrap();
|
||||
let mut options = EnvOpenOptions::new();
|
||||
options.map_size(100 * 1024 * 1024 * 1024); // 100 GB
|
||||
options.max_readers(10);
|
||||
let index = Index::new(options, database).unwrap();
|
||||
|
||||
let mut group = c.benchmark_group("search");
|
||||
group.sample_size(10);
|
||||
@ -27,13 +23,12 @@ fn bench_search(c: &mut criterion::Criterion) {
|
||||
for query in &queries {
|
||||
group.bench_with_input(BenchmarkId::from_parameter(query), &query, |b, &query| {
|
||||
b.iter(|| {
|
||||
let rtxn = env.read_txn().unwrap();
|
||||
let rtxn = index.read_txn().unwrap();
|
||||
let _documents_ids = index.search(&rtxn).query(*query).execute().unwrap();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
group.finish();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user