pub struct ParallelConfig {
pub enabled: bool,
pub min_root_entities: usize,
pub min_list_rows: usize,
pub thread_pool_size: Option<usize>,
}Expand description
Configuration for parallel parsing behavior.
Controls when parallel parsing is activated and how many threads are used. Adaptive thresholds prevent parallel overhead from slowing down small documents.
§Examples
let config = ParallelConfig {
enabled: true,
min_root_entities: 50,
min_list_rows: 100,
thread_pool_size: Some(4),
};Fields§
§enabled: boolEnable parallel parsing (default: true if feature enabled)
min_root_entities: usizeMinimum root entities to trigger parallelism (default: 50)
min_list_rows: usizeMinimum matrix rows to parse in parallel (default: 100)
thread_pool_size: Option<usize>Thread pool size (None = auto-detect cores)
Implementations§
Source§impl ParallelConfig
impl ParallelConfig
Sourcepub fn conservative() -> Self
pub fn conservative() -> Self
Create configuration for conservative parallel parsing.
Uses higher thresholds to minimize overhead for typical documents.
Sourcepub fn aggressive() -> Self
pub fn aggressive() -> Self
Create configuration for aggressive parallel parsing.
Uses lower thresholds to maximize parallelism opportunities.
Sourcepub fn should_parallelize_entities(&self, entity_count: usize) -> bool
pub fn should_parallelize_entities(&self, entity_count: usize) -> bool
Check if parallel entity parsing should be used.
Sourcepub fn should_parallelize_rows(&self, row_count: usize) -> bool
pub fn should_parallelize_rows(&self, row_count: usize) -> bool
Check if parallel row parsing should be used.
Trait Implementations§
Source§impl Clone for ParallelConfig
impl Clone for ParallelConfig
Source§fn clone(&self) -> ParallelConfig
fn clone(&self) -> ParallelConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ParallelConfig
impl Debug for ParallelConfig
Auto Trait Implementations§
impl Freeze for ParallelConfig
impl RefUnwindSafe for ParallelConfig
impl Send for ParallelConfig
impl Sync for ParallelConfig
impl Unpin for ParallelConfig
impl UnwindSafe for ParallelConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more