added xoshiro rand bench

This commit is contained in:
Dominik Maier 2020-11-27 22:32:50 +01:00
parent 5cc5f39440
commit 0cda3792d1
6 changed files with 18 additions and 10 deletions

View File

@ -9,6 +9,10 @@ edition = "2018"
[dev-dependencies]
criterion = "0.3" # Benchmarking
[[bench]]
name = "rand_speeds"
harness = false
[features]
default = ["std"]
std = []

View File

@ -0,0 +1,13 @@
use afl::utils::{Rand, XorShift64Rand, Xoshiro256StarRand};
use criterion::{black_box, criterion_group, criterion_main, Criterion};
fn criterion_benchmark(c: &mut Criterion) {
let mut xorshift = XorShift64Rand::new(0);
let mut xoshiro = Xoshiro256StarRand::new(0);
c.bench_function("xorshift", |b| b.iter(|| black_box(xorshift.next())));
c.bench_function("xoshiro", |b| b.iter(|| black_box(xoshiro.next())));
}
criterion_group!(benches, criterion_benchmark);
criterion_main!(benches);

View File

@ -22,7 +22,7 @@ where
//CE: CustomEvent<S, C, E, I, R>,
{
// TODO...
_marker: PhantomData<(S, C, E, I, R)>,
phantom: PhantomData<(S, C, E, I, R)>,
is_broker: bool,
}

View File

@ -328,13 +328,6 @@ where
dbg!("Handled {} events", count);
self.events.clear();
/*
let num = self.events.len();
for event in &self.events {}
self.events.clear();
*/
Ok(count)
}
}

View File

@ -19,7 +19,6 @@ use alloc::string::String;
use core::fmt;
#[cfg(feature = "std")]
use std::io;
use xxhash_rust::const_xxh3::xxh3_64_with_seed;
/// Main error struct for AFL
#[derive(Debug)]

View File

@ -1,6 +1,5 @@
#![cfg_attr(not(feature = "std"), no_std)]
#[macro_use]
extern crate alloc;
use alloc::boxed::Box;