pub struct MemoryBenchmark {
pub name: String,
pub tracker: AllocationTracker,
}Expand description
Memory-aware benchmark runner that tracks allocations
Fields§
§name: StringName of the benchmark
tracker: AllocationTrackerAllocation tracker for this benchmark
Implementations§
Source§impl MemoryBenchmark
impl MemoryBenchmark
Sourcepub fn run_with_tracking<F, R>(
&self,
iterations: usize,
f: F,
) -> (BenchmarkResult, AllocationStats)where
F: FnMut() -> R,
pub fn run_with_tracking<F, R>(
&self,
iterations: usize,
f: F,
) -> (BenchmarkResult, AllocationStats)where
F: FnMut() -> R,
Run a function while tracking memory allocations
Sourcepub fn compare_memory_usage<F1, F2, R1, R2>(
&self,
impl1_name: &str,
impl1: F1,
impl2_name: &str,
impl2: F2,
iterations: usize,
) -> MemoryComparison
pub fn compare_memory_usage<F1, F2, R1, R2>( &self, impl1_name: &str, impl1: F1, impl2_name: &str, impl2: F2, iterations: usize, ) -> MemoryComparison
Compare memory usage of different implementations
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for MemoryBenchmark
impl RefUnwindSafe for MemoryBenchmark
impl Send for MemoryBenchmark
impl Sync for MemoryBenchmark
impl Unpin for MemoryBenchmark
impl UnwindSafe for MemoryBenchmark
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