Add output file for benchmarks

master
Trivernis 4 years ago
parent db978eb135
commit 66df750ae8

@ -0,0 +1,12 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<option name="OTHER_INDENT_OPTIONS">
<value>
<option name="INDENT_SIZE" value="8" />
<option name="TAB_SIZE" value="16" />
<option name="USE_TAB_CHARACTER" value="true" />
<option name="SMART_TABS" value="true" />
</value>
</option>
</code_scheme>
</component>

@ -0,0 +1,5 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</state>
</component>

4
Cargo.lock generated

@ -8,9 +8,9 @@ checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d"
[[package]]
name = "benchlib-rs"
version = "0.3.1"
version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2b157249b658c600bea79e0ab5366561edf01f6e0dd0ba0075f0ad3945c2420"
checksum = "57e08932403b5810697eb9759dcaf839d1f03d65192b1dbbba5a888ae10d4e85"
dependencies = [
"rayon",
"termion",

@ -0,0 +1,19 @@
name duration standard_deviation
Empty closure 7ns 2.70ns
Empty fn 8ns 2.91ns
Empty loop to 1000 9.875µs 99.38ns
u64::MAX x u64::MAX 1000 times 11.04µs 105.08ns
f32::MAX x f32::MAX 1000 times 11.034µs 105.05ns
Bitshift u16 1 byte 1000 times 5.576µs 74.68ns
Multiply to 100 1.381µs 37.17ns
Summation from 0u32 to 10000 9ns 3.04ns
Summation from 0u64 to 10000 7ns 2.75ns
Summation from 0u128 to 10000 7ns 2.75ns
Parallel summation using rayon from 0u128 to 10000 149.392µs 386.53ns
Parallel summation with arc mutex from 0u128 to 10000 2.180271ms 1476.65ns
Spawn and stop thread 31.569µs 177.77ns
Start and stop threads==cpus 135.437µs 368.20ns
MPSC channel transmit 1000x u128 148.879µs 386.04ns
MPMC channel transmit 1000x u128 143.763µs 379.35ns
Largest prime until 1000000 24.013261ms 4902.78ns
Largest prime parallel until 1000000 7.482265ms 2736.74ns
1 name duration standard_deviation
2 Empty closure 7ns 2.70ns
3 Empty fn 8ns 2.91ns
4 Empty loop to 1000 9.875µs 99.38ns
5 u64::MAX x u64::MAX 1000 times 11.04µs 105.08ns
6 f32::MAX x f32::MAX 1000 times 11.034µs 105.05ns
7 Bitshift u16 1 byte 1000 times 5.576µs 74.68ns
8 Multiply to 100 1.381µs 37.17ns
9 Summation from 0u32 to 10000 9ns 3.04ns
10 Summation from 0u64 to 10000 7ns 2.75ns
11 Summation from 0u128 to 10000 7ns 2.75ns
12 Parallel summation using rayon from 0u128 to 10000 149.392µs 386.53ns
13 Parallel summation with arc mutex from 0u128 to 10000 2.180271ms 1476.65ns
14 Spawn and stop thread 31.569µs 177.77ns
15 Start and stop threads==cpus 135.437µs 368.20ns
16 MPSC channel transmit 1000x u128 148.879µs 386.04ns
17 MPMC channel transmit 1000x u128 143.763µs 379.35ns
18 Largest prime until 1000000 24.013261ms 4902.78ns
19 Largest prime parallel until 1000000 7.482265ms 2736.74ns

@ -5,12 +5,16 @@ mod to_bench;
use crate::to_bench::{bitshift_byte, max_f32_multiplication, max_u64_multiplications};
use benchlib::benching::Bencher;
use rayon::prelude::*;
use std::fs::File;
use std::io::BufWriter;
pub fn noop() {}
pub fn main() {
let mut bencher = Bencher::new();
let file = File::create("benchmarks.tsv").unwrap();
bencher
.write_output_to(BufWriter::new(file))
.set_iterations(10000)
.print_settings()
.bench("Empty closure", || {})
@ -64,7 +68,9 @@ pub fn main() {
.bench("Largest prime parallel until 1000000", || {
to_bench::largest_prime_par(1000000)
})
.compare();
.compare()
.flush()
.unwrap();
}
#[cfg(test)]

Loading…
Cancel
Save