From: MA Beaudet Date: Sun, 14 Nov 2021 20:45:15 +0000 (+0100) Subject: fix(freq_count): change benchmark to compare single threaded to others X-Git-Url: https://git.beaudet.xyz/?a=commitdiff_plain;h=d2c07859ed0dca6e8fc8acc18ec37610e6a6e136;p=poker-eval.git fix(freq_count): change benchmark to compare single threaded to others --- diff --git a/examples/freq_count.rs b/examples/freq_count.rs index 91ae6c8..f77bcf4 100644 --- a/examples/freq_count.rs +++ b/examples/freq_count.rs @@ -11,15 +11,9 @@ fn main() { let start = Instant::now(); - #[cfg(not(feature = "parallel"))] println!("Frequency count for all five-hand poker hands"); let freq = deck_freq_evaluator(&deck); - #[cfg(feature = "parallel")] - println!("Concurrent frequency count for all five-hand poker hands using rayon"); - #[cfg(feature = "parallel")] - let freq = concurrent_deck_freq_evaluator(&deck); - let duration = start.elapsed(); for i in 1..=9 { @@ -36,8 +30,15 @@ fn main() { println!(); let start = Instant::now(); + #[cfg(not(feature = "rayon"))] println!("Concurrent frequency count for all five-hand poker hands"); + #[cfg(not(feature = "rayon"))] let freq = parallel_deck_freq_evaluator(&deck); + #[cfg(feature = "rayon")] + println!("Concurrent frequency count for all five-hand poker hands using rayon"); + #[cfg(feature = "rayon")] + let freq = concurrent_deck_freq_evaluator(&deck); + let duration = start.elapsed(); for i in 1..=9 {