pub struct Cache<T> { /* private fields */ }Expand description
Cache holding values retrieved from the za array.
This object caches the values extracted from the za array, which are more likely to be used
again, either by evaluating the spline to a nearby point, or/and by evaluating it’s derivates
as well.
Only the grid points are cached, not any interpolated values.
This optimization seems to be quite effective (up to +50% from my testing), and could be
important in cases where za arrays are big and don’t fit in the CPU’s cache. It is of course,
very situational, since it also depends on the way one evaluates his splines.
The overhead of cache misses should be truly negligible, since the process just falls back to calculating the values in the usual manner.
Implementations§
Trait Implementations§
impl<T: Copy> Copy for Cache<T>
Auto Trait Implementations§
impl<T> Freeze for Cache<T>where
T: Freeze,
impl<T> RefUnwindSafe for Cache<T>where
T: RefUnwindSafe,
impl<T> Send for Cache<T>where
T: Send,
impl<T> Sync for Cache<T>where
T: Sync,
impl<T> Unpin for Cache<T>where
T: Unpin,
impl<T> UnsafeUnpin for Cache<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Cache<T>where
T: UnwindSafe,
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