mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-30 09:04:59 +08:00
fix(core): fix benchmark in core with types
forces a dereference onto query and then creates an option to wrap the query Closes 994
This commit is contained in:
parent
b406b6ee44
commit
0a2ca075d3
@ -15,7 +15,7 @@ use meilisearch_core::settings::{Settings, SettingsUpdate};
|
|||||||
use meilisearch_schema::Schema;
|
use meilisearch_schema::Schema;
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
|
|
||||||
use criterion::{criterion_group, criterion_main, Criterion, BenchmarkId};
|
use criterion::{black_box, criterion_group, criterion_main, Criterion, BenchmarkId};
|
||||||
|
|
||||||
fn prepare_database(path: &Path) -> Database {
|
fn prepare_database(path: &Path) -> Database {
|
||||||
let database = Database::open_or_create(path, DatabaseOptions::default()).unwrap();
|
let database = Database::open_or_create(path, DatabaseOptions::default()).unwrap();
|
||||||
@ -98,7 +98,7 @@ pub fn criterion_benchmark(c: &mut Criterion) {
|
|||||||
let bench_name = BenchmarkId::from_parameter(format!("{:?}", query));
|
let bench_name = BenchmarkId::from_parameter(format!("{:?}", query));
|
||||||
group.bench_with_input(bench_name, &query, |b, query| b.iter(|| {
|
group.bench_with_input(bench_name, &query, |b, query| b.iter(|| {
|
||||||
let builder = index.query_builder();
|
let builder = index.query_builder();
|
||||||
builder.query(&reader, query, 0..20).unwrap();
|
builder.query(&reader, Some(*query), 0..20).unwrap();
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
group.finish();
|
group.finish();
|
||||||
|
Loading…
Reference in New Issue
Block a user