pub struct WidthPolicy {
pub serial_below_ns: f64,
pub entry_base_ns: f64,
pub entry_per_thread_ns: f64,
}Expand description
Cost model for choosing a barrier-free partition width from the work.
T_par(k) = entry_base_ns + entry_per_thread_ns * k + serial_ns / k for
k > 1; work below serial_below_ns always runs serially. The defaults
are provisional values from experiments/rayon-entry (M5 Max,
2026-09-29); kernels replace them with their own measured policy.
§Examples
let p = tcontract_exec::WidthPolicy::default();
assert_eq!(p.serial_below_ns, 50_000.0);Fields§
§serial_below_ns: f64Estimated serial time below which work never leaves the caller.
entry_base_ns: f64Fixed part of the pool entry cost.
entry_per_thread_ns: f64Entry cost added per participating worker.
Trait Implementations§
Source§impl Clone for WidthPolicy
impl Clone for WidthPolicy
impl Copy for WidthPolicy
Source§impl Debug for WidthPolicy
impl Debug for WidthPolicy
Source§impl Default for WidthPolicy
impl Default for WidthPolicy
Source§impl PartialEq for WidthPolicy
impl PartialEq for WidthPolicy
impl StructuralPartialEq for WidthPolicy
Auto Trait Implementations§
impl Freeze for WidthPolicy
impl RefUnwindSafe for WidthPolicy
impl Send for WidthPolicy
impl Sync for WidthPolicy
impl Unpin for WidthPolicy
impl UnsafeUnpin for WidthPolicy
impl UnwindSafe for WidthPolicy
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