pub fn parallel_count<T, I, P>(items: I, predicate: P) -> usizeExpand description
Count items matching a predicate in parallel.
Efficiently counts matching items using fold-reduce, with no lock contention between threads.
§Example
ⓘ
use grafeo_core::execution::parallel::fold::parallel_count;
use rayon::prelude::*;
let numbers: Vec<i32> = (0..1000).collect();
let even_count = parallel_count(numbers.par_iter(), |n| *n % 2 == 0);
assert_eq!(even_count, 500);