From 15abbe4cdaec28004f7de4f065978d30b2e29826 Mon Sep 17 00:00:00 2001 From: Alexander Date: Fri, 6 May 2022 17:14:53 +0300 Subject: update benchmarks --- benches/benchmark.rs | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/benches/benchmark.rs b/benches/benchmark.rs index 4856478..493c0fb 100644 --- a/benches/benchmark.rs +++ b/benches/benchmark.rs @@ -1,11 +1,12 @@ use criterion::{black_box, criterion_group, criterion_main, Criterion,BatchSize}; +use std::time::Duration; use correlation_rust::correlations::Compute; fn criterion_benchmark(c: &mut Criterion) { - c.bench_function("correlation_rust", |b|b.iter(||{ + c.bench_function("correlation with 300thousand rows", |b|b.iter(||{ let x_vals = [25.08439 ,72.02225 ,47.56293 ,22.87893 ,14.28721 ,71.84655 ,87.81991 ,84.86824 ,6.72478 ,5.72373 ,73.47078 ,63.74703]; @@ -14,7 +15,22 @@ fn criterion_benchmark(c: &mut Criterion) { compute_obj.compute(); })); + c.bench_function("correlation with 800thousand rows", |b|b.iter(||{ + + let x_vals = [25.08439 ,72.02225 ,47.56293 ,22.87893 ,14.28721 ,71.84655 ,87.81991 ,84.86824 ,6.72478 ,5.72373 ,73.47078 ,63.74703]; + + let compute_obj = Compute::new(',',"pearson","/home/kabui/correlation_rust/src/matrix_80.txt",&x_vals); + + compute_obj.compute(); + })); + } -criterion_group!(benches, criterion_benchmark); + +criterion_group!{ + name = benches; + config = Criterion::default().sample_size(10000).measurement_time(Duration::from_secs(20)); + targets = criterion_benchmark + } +//criterion_group!(benches, criterion_benchmark); criterion_main!(benches); \ No newline at end of file -- cgit 1.4.1