From 492d6afd642e575b95025295f31945413de8baee Mon Sep 17 00:00:00 2001 From: Phillip Lord Date: Fri, 21 Jun 2024 17:21:39 +0100 Subject: [PATCH] Update graph presentation --- .gitignore | 5 ++++- benches/io.rs | 5 ++--- benches/model.rs | 10 +++++----- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index acb7ad2..9d7b0f7 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,7 @@ Cargo.lock .vscode/ # Mac OS X -.DS_Store \ No newline at end of file +.DS_Store +/flamegraph.svg +/perf.data +/perf.data.old diff --git a/benches/io.rs b/benches/io.rs index bdd7808..125e987 100644 --- a/benches/io.rs +++ b/benches/io.rs @@ -1,14 +1,13 @@ -use criterion::{criterion_group, BenchmarkId, Criterion, Throughput}; +use criterion::{criterion_group, AxisScale, BenchmarkId, Criterion, PlotConfiguration}; use std::fs::File; use std::io::BufReader; use std::time::Duration; fn io_read(c: &mut Criterion) { let mut group = c.benchmark_group("io_read"); + group.plot_config(PlotConfiguration::default().summary_scale(AxisScale::Logarithmic)); for n in [10, 100, 1_000, 2500, 5000, 10_000].iter() { - group.throughput(Throughput::Elements(*n as u64)); - group.bench_with_input(BenchmarkId::new("owl_io_read", n), n, |b, &n| { b.iter(|| { let f = File::open(format!("benches/ont/o{}.owl", n)).ok().unwrap(); diff --git a/benches/model.rs b/benches/model.rs index 0159c65..e250a50 100644 --- a/benches/model.rs +++ b/benches/model.rs @@ -1,7 +1,7 @@ use std::io::Cursor; use std::rc::Rc; -use criterion::{criterion_group, BenchmarkId, Criterion, Throughput}; +use criterion::{criterion_group, AxisScale, BenchmarkId, Criterion, PlotConfiguration}; use horned_owl::io::rdf::reader::RDFOntology; use horned_owl::model::*; @@ -26,9 +26,9 @@ fn create_many_classes(i: isize) { // We start by testing the basic ontology model fn classes(c: &mut Criterion) { let mut group = c.benchmark_group("classes"); + group.plot_config(PlotConfiguration::default().summary_scale(AxisScale::Logarithmic)); for n in [100, 1_000, 10_000, 100_000].iter() { - group.throughput(Throughput::Elements(*n as u64)); group.bench_with_input(BenchmarkId::from_parameter(n), n, |b, &n| { b.iter(|| create_many_classes(n)); }); @@ -79,9 +79,9 @@ fn create_tree_0>( // Now test to see what impact the pointer and caching of strings has fn tree(c: &mut Criterion) { let mut group = c.benchmark_group("tree"); + group.plot_config(PlotConfiguration::default().summary_scale(AxisScale::Logarithmic)); for n in [100, 1_000, 10_000, 100_000].iter() { - group.throughput(Throughput::Elements(*n as u64)); group.bench_with_input(BenchmarkId::new("Rc", n), n, |b, &n| { b.iter(|| { let b = Build::new_rc(); @@ -111,9 +111,9 @@ fn tree(c: &mut Criterion) { // Now test to see the impact of the pointers in indexes have fn set_index_tree(c: &mut Criterion) { let mut group = c.benchmark_group("set_index_tree"); + group.plot_config(PlotConfiguration::default().summary_scale(AxisScale::Logarithmic)); for n in [100, 1_000, 10_000, 100_000].iter() { - group.throughput(Throughput::Elements(*n as u64)); group.bench_with_input(BenchmarkId::new("SetOntology", n), n, |b, &n| { b.iter(|| { let b = Build::new_rc(); @@ -143,9 +143,9 @@ fn set_index_tree(c: &mut Criterion) { // Test all of the different indexes fn multi_index_tree(c: &mut Criterion) { let mut group = c.benchmark_group("multi_index_tree"); + group.plot_config(PlotConfiguration::default().summary_scale(AxisScale::Logarithmic)); for n in [100, 1_000, 10_000, 50_000, 100_000].iter() { - group.throughput(Throughput::Elements(*n as u64)); group.bench_with_input(BenchmarkId::new("SetOntology", n), n, |b, &n| { b.iter(|| { let b = Build::new_rc();