pub struct ParallelPolicy {
pub min_parallel_shard_bytes: usize,
pub min_bytes_per_job: usize,
pub max_jobs: usize,
pub l2_cache_bytes: usize,
}Fields§
§min_parallel_shard_bytes: usize§min_bytes_per_job: usize§max_jobs: usize§l2_cache_bytes: usizeEstimated L2 cache size per core in bytes. Used to bound chunk sizes so each job’s working set fits in L2. Set to 0 to disable cache-aware sizing.
Implementations§
Source§impl ParallelPolicy
impl ParallelPolicy
Sourcepub fn decide(
&self,
shard_size: usize,
data_shards: usize,
output_shards: usize,
available_parallelism: usize,
) -> ParallelDecision
pub fn decide( &self, shard_size: usize, data_shards: usize, output_shards: usize, available_parallelism: usize, ) -> ParallelDecision
Decide whether to use parallel execution and how to chunk the work.
Sourcepub fn with_l2_cache_bytes(self, bytes: usize) -> Self
pub fn with_l2_cache_bytes(self, bytes: usize) -> Self
Builder-style setter for L2 cache size.
Sourcepub fn with_env_overrides(self) -> Self
pub fn with_env_overrides(self) -> Self
Apply environment variable overrides (RS_PARALLEL_POLICY_*) to this policy.
Trait Implementations§
Source§impl Clone for ParallelPolicy
impl Clone for ParallelPolicy
Source§fn clone(&self) -> ParallelPolicy
fn clone(&self) -> ParallelPolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ParallelPolicy
Source§impl Debug for ParallelPolicy
impl Debug for ParallelPolicy
Source§impl Default for ParallelPolicy
Available on crate feature std only.
impl Default for ParallelPolicy
Available on crate feature
std only.impl Eq for ParallelPolicy
Source§impl PartialEq for ParallelPolicy
impl PartialEq for ParallelPolicy
impl StructuralPartialEq for ParallelPolicy
Auto Trait Implementations§
impl Freeze for ParallelPolicy
impl RefUnwindSafe for ParallelPolicy
impl Send for ParallelPolicy
impl Sync for ParallelPolicy
impl Unpin for ParallelPolicy
impl UnsafeUnpin for ParallelPolicy
impl UnwindSafe for ParallelPolicy
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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