Skip to main content

map_cpu

Function map_cpu 

Source
pub fn map_cpu<T, R, F>(items: &[T], f: F) -> Vec<R>
where T: Sync, R: Send, F: Fn(&T) -> R + Sync + Send,
Expand description

CPU map over a slice: sequential when items.len() < CPU_MAP_THRESHOLD, else Rayon under install_rayon_pool_once (pool sized to budget).

Prefer this over ad-hoc par_iter so small collections never pay Rayon overhead.