Skip to main content

Module parallel

Module parallel 

Source
Expand description

Portable parallel iteration abstractions

This module provides parallel iteration that works across all build targets:

  • native feature: Uses native rayon for maximum performance
  • wasm feature: Uses wasm-bindgen-rayon for Web Worker parallelism
  • Neither: Falls back to sequential iteration

§Usage

use crate::core::parallel::*;

// Parallel map over a slice
let results: Vec<i32> = parallel_map(&data, |item| item * 2);

// Parallel map over indices
let results: Vec<i32> = parallel_map_indexed(100, |i| i * 2);

Functions§

is_parallel_available
Check if parallel processing is available
parallel_enumerate_filter_map
Parallel enumerate and filter_map over a slice
parallel_enumerate_map
Parallel enumerate and map over a slice
parallel_filter_map
Parallel filter_map over a slice
parallel_flat_map
Parallel flat_map over a slice
parallel_for_each
Parallel for_each over a slice
parallel_map
Parallel map over a slice
parallel_map_indexed
Parallel map over a range of indices