diff options
author | Aria <me@aria.rip> | 2023-10-31 16:09:59 +0000 |
---|---|---|
committer | Aria <me@aria.rip> | 2023-10-31 16:09:59 +0000 |
commit | 23dcf32d4a95cc6357ca6081c0927c6d02582334 (patch) | |
tree | 9c10d1ad92ce8a62ddc02f0d1647f934687af6aa /primrose/crates/candelabra-benchmarker/src | |
parent | f7a3521c740479eb9a415eaec31f412522bc1917 (diff) |
style(all): fix clippy lints
Diffstat (limited to 'primrose/crates/candelabra-benchmarker/src')
4 files changed, 6 insertions, 4 deletions
diff --git a/primrose/crates/candelabra-benchmarker/src/bench.rs b/primrose/crates/candelabra-benchmarker/src/bench.rs index c2c8bea..161099a 100644 --- a/primrose/crates/candelabra-benchmarker/src/bench.rs +++ b/primrose/crates/candelabra-benchmarker/src/bench.rs @@ -17,7 +17,8 @@ pub fn benchmark_op<T>( mut op: impl FnMut(&mut T), mut undo: impl FnMut(&mut T), ) -> RunResults { - let loop_end = Instant::now() + Duration::from_secs(5); + // let loop_end = Instant::now() + Duration::from_secs(5); + let loop_end = Instant::now() + Duration::from_millis(100); let mut times = 0; let mut min = Duration::from_secs(u64::MAX); @@ -26,6 +27,7 @@ pub fn benchmark_op<T>( let mut target = setup(); while Instant::now() + max < loop_end { + #[allow(clippy::unit_arg)] // pretty sure this is necessary to prevent optimisations let duration = time_singular(|| black_box(op(&mut target))); undo(&mut target); diff --git a/primrose/crates/candelabra-benchmarker/src/indexable.rs b/primrose/crates/candelabra-benchmarker/src/indexable.rs index 915d093..7819ec5 100644 --- a/primrose/crates/candelabra-benchmarker/src/indexable.rs +++ b/primrose/crates/candelabra-benchmarker/src/indexable.rs @@ -4,7 +4,7 @@ use log::debug; use primrose_library::traits::{Container, Indexable}; use rand::{distributions::Standard, prelude::Distribution, random}; -use crate::{benchmark_op, Results, RunResults, SingleNResults}; +use crate::{benchmark_op, RunResults, SingleNResults}; /// Benchmark [`primrose_library::traits::Indexable`] operations pub trait IndexableExt<E> { diff --git a/primrose/crates/candelabra-benchmarker/src/lib.rs b/primrose/crates/candelabra-benchmarker/src/lib.rs index 3361048..abe8f0a 100644 --- a/primrose/crates/candelabra-benchmarker/src/lib.rs +++ b/primrose/crates/candelabra-benchmarker/src/lib.rs @@ -27,7 +27,7 @@ impl<T, E> Benchmarker<T, E> { Results { by_n: HashMap::new(), }, - PhantomData::default(), + PhantomData, ) } diff --git a/primrose/crates/candelabra-benchmarker/src/stack.rs b/primrose/crates/candelabra-benchmarker/src/stack.rs index f6b32f0..9deb852 100644 --- a/primrose/crates/candelabra-benchmarker/src/stack.rs +++ b/primrose/crates/candelabra-benchmarker/src/stack.rs @@ -4,7 +4,7 @@ use log::debug; use primrose_library::traits::Stack; use rand::{distributions::Standard, prelude::Distribution, random}; -use crate::{benchmark_op, Results, RunResults, SingleNResults}; +use crate::{benchmark_op, RunResults, SingleNResults}; /// Benchmark [`primrose_library::traits::Stack`] operations pub trait StackExt<E> { |