pub struct MemoryMetrics {
pub peak_memory_usage: usize,
pub total_number_of_allocations: usize,
pub allocated_buffers_size: Vec<usize>,
pub total_memory_allocated: usize,
pub output_memory_usage: usize,
}Expand description
A snapshot of the allocations a Skeleton will perform when run.
Returned by Skeleton::memory_report; every field is in bytes and reflects
the plan’s cache state at the moment the report was taken.
§Note
All allocations are reported as Candela sees them; they do not account for caching or memory reuse by the system allocator, so the figures may differ from what actually happens at runtime.
§Examples
use candela::skeleton::SkeletonSlot;
let slot = SkeletonSlot::from_shape(&[4]);
let skeleton = (&slot * 2.0 + 1.0).into_skeleton(&[slot])?;
let report = skeleton.memory_report();
// Every field is in bytes; a [4] f64 output is 4 * 8 = 32 bytes.
assert_eq!(report.output_memory_usage, 32);
assert!(report.peak_memory_usage >= report.output_memory_usage);Fields§
§peak_memory_usage: usizepeak memory usage in bytes
total_number_of_allocations: usizenumber of allocations performed
allocated_buffers_size: Vec<usize>the sizes, in bytes, of all allocated buffers
total_memory_allocated: usizetotal memory allocated in bytes
output_memory_usage: usizethe size, in bytes, of the output node
Trait Implementations§
Source§impl Clone for MemoryMetrics
impl Clone for MemoryMetrics
Source§fn clone(&self) -> MemoryMetrics
fn clone(&self) -> MemoryMetrics
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 moreSource§impl Debug for MemoryMetrics
impl Debug for MemoryMetrics
impl Eq for MemoryMetrics
Source§impl PartialEq for MemoryMetrics
impl PartialEq for MemoryMetrics
Source§fn eq(&self, other: &MemoryMetrics) -> bool
fn eq(&self, other: &MemoryMetrics) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for MemoryMetrics
Auto Trait Implementations§
impl Freeze for MemoryMetrics
impl RefUnwindSafe for MemoryMetrics
impl Send for MemoryMetrics
impl Sync for MemoryMetrics
impl Unpin for MemoryMetrics
impl UnsafeUnpin for MemoryMetrics
impl UnwindSafe for MemoryMetrics
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