pub struct PerformanceHints {
pub complexity: ComplexityClass,
pub simd_friendly: bool,
pub parallelizable: bool,
pub gpu_friendly: bool,
pub memory_pattern: MemoryPattern,
pub cache_behavior: CacheBehavior,
pub io_pattern: IoPattern,
pub optimization_level: OptimizationLevel,
pub custom_hints: HashMap<String, String>,
pub expected_duration: Option<DurationRange>,
pub memory_requirements: Option<MemoryRequirements>,
}Expand description
Performance characteristics of a function
Fields§
§complexity: ComplexityClassExpected computational complexity (e.g., O(n), O(n²), etc.)
simd_friendly: boolWhether the function benefits from SIMD optimization
parallelizable: boolWhether the function can be parallelized
gpu_friendly: boolWhether the function benefits from GPU acceleration
memory_pattern: MemoryPatternExpected memory usage pattern
cache_behavior: CacheBehaviorCache behavior characteristics
io_pattern: IoPatternI/O characteristics
optimization_level: OptimizationLevelPreferred optimization level
custom_hints: HashMap<String, String>Function-specific optimization hints
expected_duration: Option<DurationRange>Expected execution time range
memory_requirements: Option<MemoryRequirements>Memory requirements
Implementations§
Source§impl PerformanceHints
impl PerformanceHints
Sourcepub fn with_complexity(self, complexity: ComplexityClass) -> Self
pub fn with_complexity(self, complexity: ComplexityClass) -> Self
Set the computational complexity
Sourcepub fn simd_friendly(self) -> Self
pub fn simd_friendly(self) -> Self
Mark as SIMD-friendly
Sourcepub fn parallelizable(self) -> Self
pub fn parallelizable(self) -> Self
Mark as parallelizable
Sourcepub fn gpu_friendly(self) -> Self
pub fn gpu_friendly(self) -> Self
Mark as GPU-friendly
Sourcepub fn with_memory_pattern(self, pattern: MemoryPattern) -> Self
pub fn with_memory_pattern(self, pattern: MemoryPattern) -> Self
Set memory access pattern
Sourcepub fn with_cache_behavior(self, behavior: CacheBehavior) -> Self
pub fn with_cache_behavior(self, behavior: CacheBehavior) -> Self
Set cache behavior
Sourcepub fn with_io_pattern(self, pattern: IoPattern) -> Self
pub fn with_io_pattern(self, pattern: IoPattern) -> Self
Set I/O pattern
Sourcepub fn with_optimization_level(self, level: OptimizationLevel) -> Self
pub fn with_optimization_level(self, level: OptimizationLevel) -> Self
Set optimization level
Sourcepub fn with_custom_hint<K: Into<String>, V: Into<String>>(
self,
key: K,
value: V,
) -> Self
pub fn with_custom_hint<K: Into<String>, V: Into<String>>( self, key: K, value: V, ) -> Self
Add a custom hint
Sourcepub fn with_expected_duration(self, range: DurationRange) -> Self
pub fn with_expected_duration(self, range: DurationRange) -> Self
Set expected duration range
Sourcepub fn with_memory_requirements(self, requirements: MemoryRequirements) -> Self
pub fn with_memory_requirements(self, requirements: MemoryRequirements) -> Self
Set memory requirements
Sourcepub fn get_custom_hint(&self, key: &str) -> Option<&String>
pub fn get_custom_hint(&self, key: &str) -> Option<&String>
Get a specific custom hint
Sourcepub fn should_use_simd(&self) -> bool
pub fn should_use_simd(&self) -> bool
Check if the function should use SIMD optimization
Sourcepub fn should_parallelize(&self) -> bool
pub fn should_parallelize(&self) -> bool
Check if the function should be parallelized
Sourcepub fn should_use_gpu(&self) -> bool
pub fn should_use_gpu(&self) -> bool
Check if the function should use GPU acceleration
Sourcepub fn should_chunk(&self, inputsize: usize) -> bool
pub fn should_chunk(&self, inputsize: usize) -> bool
Estimate if the operation is suitable for chunking
Trait Implementations§
Source§impl Clone for PerformanceHints
impl Clone for PerformanceHints
Source§fn clone(&self) -> PerformanceHints
fn clone(&self) -> PerformanceHints
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PerformanceHints
impl Debug for PerformanceHints
Source§impl Default for PerformanceHints
impl Default for PerformanceHints
Source§impl PartialEq for PerformanceHints
impl PartialEq for PerformanceHints
impl StructuralPartialEq for PerformanceHints
Auto Trait Implementations§
impl Freeze for PerformanceHints
impl RefUnwindSafe for PerformanceHints
impl Send for PerformanceHints
impl Sync for PerformanceHints
impl Unpin for PerformanceHints
impl UnwindSafe for PerformanceHints
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
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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 moreSource§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.