Skip to main content

chunk_process

Function chunk_process 

Source
pub fn chunk_process<T, R, F>(data: &[T], chunk_size: usize, f: F) -> Vec<R>
where T: Clone, F: Fn(&[T]) -> Vec<R>,
Expand description

Process data in fixed-size chunks, applying f to each chunk and collecting the results into a flat VecR`.

This pattern mirrors hand-written SIMD loops where a fixed “vector width” is processed per iteration. Here chunk_size plays the role of the SIMD lane count.