
* sort memebers * Building bolts * fixing python, feature flags * Cleanup bolts Cargo.toml * Fix tests * cleanup libafl * removed duplicate examples * Info text * reenable agpl CI * fix impl_serdeany * new fmt * Moved bolts * fix some builds * fix * fix more fixes * serdeany * no_std * Dependency cleanup * Fix docs * Docker * add python bolts bindings * no_std test fix * merge fail * typo fix * add bolts dependency to fuzzers * tiny fixes * merge fun * clippy * link no longer exists * make sure python gets rebuilt * fix pybind * doc fix * remove bolts ref * LibAFL bolts * More info * deprecation notice for launcher * fix python * cargo fmt * fix concolic * fix * clippy * fix libafl_cc * fix tutorial, clippy * fix concolic fuzzer * fix push_stage_harness fuzzer * prelude * fix testcase post-merge * mute clippy
24 lines
992 B
Rust
24 lines
992 B
Rust
//! Compare the speed of rand implementations
|
|
|
|
use criterion::{black_box, criterion_group, criterion_main, Criterion};
|
|
use libafl_bolts::rands::{
|
|
Lehmer64Rand, Rand, RomuDuoJrRand, RomuTrioRand, XorShift64Rand, Xoshiro256StarRand,
|
|
};
|
|
|
|
fn criterion_benchmark(c: &mut Criterion) {
|
|
let mut xorshift = XorShift64Rand::with_seed(1);
|
|
let mut xoshiro = Xoshiro256StarRand::with_seed(1);
|
|
let mut romu = RomuDuoJrRand::with_seed(1);
|
|
let mut lehmer = Lehmer64Rand::with_seed(1);
|
|
let mut romu_trio = RomuTrioRand::with_seed(1);
|
|
|
|
c.bench_function("xorshift", |b| b.iter(|| black_box(xorshift.next())));
|
|
c.bench_function("xoshiro", |b| b.iter(|| black_box(xoshiro.next())));
|
|
c.bench_function("romu", |b| b.iter(|| black_box(romu.next())));
|
|
c.bench_function("romu_trio", |b| b.iter(|| black_box(romu_trio.next())));
|
|
c.bench_function("lehmer", |b| b.iter(|| black_box(lehmer.next())));
|
|
}
|
|
|
|
criterion_group!(benches, criterion_benchmark);
|
|
criterion_main!(benches);
|