about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlexander <alexanderkabua@gmail.com>2022-05-06 17:14:53 +0300
committerAlexander <alexanderkabua@gmail.com>2022-05-06 17:14:53 +0300
commit15abbe4cdaec28004f7de4f065978d30b2e29826 (patch)
treed20dfc8c2f998b57bf3b159e5db631b7813cc6ba
parentfd13ef6d9905fdccc0ddfacb4508e1b39979cfae (diff)
downloadcorrelation_rust-15abbe4cdaec28004f7de4f065978d30b2e29826.tar.gz
update benchmarks
-rw-r--r--benches/benchmark.rs20
1 files 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