#[non_exhaustive]pub struct ResourceEstimate { /* private fields */ }Expand description
Predicted resources for a conversion plan. Every field is Option —
fillers may model what they can and leave the rest None. wall_ms is
already scaled to compute.cores() when produced by
ConvertPlan::estimate_in; the internal
threading-bottleneck model is in estimate_plan (docs/ESTIMATE.md).
#[non_exhaustive], shape-compatible with
zencodec::estimate::ResourceEstimate; build via new /
unknown + the with_* setters.
Implementations§
Source§impl ResourceEstimate
impl ResourceEstimate
Sourcepub fn new(peak_memory_bytes_est: u64, wall_ms: u64) -> Self
pub fn new(peak_memory_bytes_est: u64, wall_ms: u64) -> Self
Estimate from the two essentials: typical peak memory + wall time.
Buffer count left None; refine with
with_intermediate_buffer_count.
Sourcepub fn with_intermediate_buffer_count(self, n: u32) -> Self
pub fn with_intermediate_buffer_count(self, n: u32) -> Self
Full-image intermediate buffers held simultaneously, NOT counting input or output. Distinguishes 1-giant-buffer from N-medium-buffer plans for paging-pressure decisions.
Sourcepub fn peak_memory_bytes_est(&self) -> Option<u64>
pub fn peak_memory_bytes_est(&self) -> Option<u64>
Typical (≈ p50) estimated peak memory, bytes.
Sourcepub fn wall_ms(&self) -> Option<u64>
pub fn wall_ms(&self) -> Option<u64>
Predicted wall-clock ms. Already scaled to
ComputeEnvironment::cores when produced by
ConvertPlan::estimate_in.
Rounded up, so sub-millisecond work reports Some(1) and
Some(0) means genuinely zero work (empty plan / zero pixels) —
schedulers summing many small conversions overestimate slightly
rather than seeing a stream of zeros.
Sourcepub fn intermediate_buffer_count(&self) -> Option<u32>
pub fn intermediate_buffer_count(&self) -> Option<u32>
Full-image intermediate buffers held simultaneously (input/output
excluded). None when the planner can’t determine it.
Trait Implementations§
Source§impl Clone for ResourceEstimate
impl Clone for ResourceEstimate
Source§fn clone(&self) -> ResourceEstimate
fn clone(&self) -> ResourceEstimate
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more