Skip to main content

Module parallel

Module parallel 

Source
Expand description

Parallel page-processing utilities.

On native targets: uses rayon for data parallelism. On wasm32: falls back to sequential iteration.

Provides helpers that apply a per-page transformation in parallel across all pages of a document. Designed as a drop-in replacement for the sequential for page in &mut pages { ... } loops in the orchestrator.

Functions§

configure_thread_pool
Configure the global rayon thread pool with the given number of threads.
par_extract
Parallel fold — map each page to a value of type T and collect results.
par_map_pages
Apply op to each page in parallel, replacing each page’s content.
par_map_pages_indexed
Apply op to each page in parallel where the closure also receives a zero-based page index.