Reduce the length of the benchmarks names

This commit is contained in:
Kerollmops 2021-06-03 15:59:43 +02:00
parent 76a2343639
commit 29824d05ab
No known key found for this signature in database
GPG Key ID: 92ADA4E935E71FA4
3 changed files with 11 additions and 9 deletions

10
Cargo.lock generated
View File

@ -900,7 +900,7 @@ dependencies = [
[[package]]
name = "helpers"
version = "0.2.1"
version = "0.3.0"
dependencies = [
"anyhow",
"byte-unit",
@ -954,7 +954,7 @@ dependencies = [
[[package]]
name = "http-ui"
version = "0.2.1"
version = "0.3.0"
dependencies = [
"anyhow",
"askama",
@ -1095,7 +1095,7 @@ dependencies = [
[[package]]
name = "infos"
version = "0.2.1"
version = "0.3.0"
dependencies = [
"anyhow",
"byte-unit",
@ -1358,7 +1358,7 @@ dependencies = [
[[package]]
name = "milli"
version = "0.2.1"
version = "0.3.0"
dependencies = [
"anyhow",
"big_s",
@ -2215,7 +2215,7 @@ dependencies = [
[[package]]
name = "search"
version = "0.2.1"
version = "0.3.0"
dependencies = [
"anyhow",
"byte-unit",

View File

@ -10,7 +10,7 @@ milli = { path = "../milli" }
[dev-dependencies]
heed = "*" # we want to use the version milli uses
criterion = "0.3.4"
criterion = { version = "0.3.4", features = ["html_reports"] }
[build-dependencies]
anyhow = "1.0"

View File

@ -1,4 +1,5 @@
use std::fs::{create_dir_all, remove_dir_all, File};
use std::path::Path;
use criterion::BenchmarkId;
use heed::EnvOpenOptions;
@ -97,7 +98,9 @@ pub fn run_benches(c: &mut criterion::Criterion, confs: &[Conf]) {
for conf in confs {
let index = base_setup(conf);
let mut group = c.benchmark_group(&format!("{}: {}", conf.dataset, conf.group_name));
let file_name = Path::new(conf.dataset).file_name().and_then(|f| f.to_str()).unwrap();
let name = format!("{}: {}", file_name, conf.group_name);
let mut group = c.benchmark_group(&name);
for &query in conf.queries {
group.bench_with_input(BenchmarkId::from_parameter(query), &query, |b, &query| {
@ -106,8 +109,7 @@ pub fn run_benches(c: &mut criterion::Criterion, confs: &[Conf]) {
let mut search = index.search(&rtxn);
search.query(query).optional_words(conf.optional_words);
if let Some(filter) = conf.filter {
let filter =
FilterCondition::from_str(&rtxn, &index, filter).unwrap();
let filter = FilterCondition::from_str(&rtxn, &index, filter).unwrap();
search.filter(filter);
}
let _ids = search.execute().unwrap();