1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
use correlation_rust::correlations::Compute;
use criterion::{criterion_group, criterion_main, Criterion};
use std::time::Duration;
#[allow(unused_must_use)]
fn criterion_benchmark(c: &mut Criterion) {
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,
];
let compute_obj = Compute::new(
',',
"pearson",
"/home/kabui/correlation_rust/src/db300.txt",
&x_vals,
"/output.txt",
);
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,
"/output.txt",
);
compute_obj.compute();
})
});
}
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);
|