Appearance
cellpack::opt::CostModel
Module contract · All interfaces
At a glance
pub struct CostModel {Show 13 fields
pub cores: f64,
pub iops: f64,
pub bandwidth: f64,
pub memory_bandwidth: f64,
pub serial: f64,
pub bucket: u64,
pub access: f64,
pub request: f64,
pub compile: f64,
pub input: InputCost,
pub rows: RowCost,
pub outputs: Vec<OutputCost>,
pub convert: [f64; 6],
}The loader’s resources on one machine and the work it does per access, record, element, request and cached-row byte. Work is in core-seconds: seconds of one physical core (two workers sharing a core through SMT take it together).
Fields and variants
cores
cores: f64Physical cores the workers run on (at most one per worker).
iops
iops: f64Read requests per second the device sustains.
bandwidth
bandwidth: f64Bytes per second the device sustains.
memory_bandwidth
memory_bandwidth: f64Bytes per second of cached-row traffic main memory sustains.
serial
serial: f64Share of the shorter of device and worker time that does not overlap the longer, in [0, 1].
bucket
bucket: u64Accesses per priced window.
access
access: f64Every access: claiming, bookkeeping, completing, the ring.
request
request: f64One read request: building, submitting and harvesting it.
compile
compile: f64The online compiler, per access, where it shares the workers’ cores.
input
input: InputCostDecoding records.
rows
rows: RowCostCached rows.
outputs
outputs: Vec<OutputCost>Per output schema, in loader order.
convert
Converting an element, per Conversion class, on top of the schema’s map_element.
Member index
6 of 6 members
defaultsDefault costs (see crate::opt::defaults ) for a loader whose workers run on cores physical cores, reading storage of tier , with builtin[k] telling whether schema k is the built-in output.secondsModeled seconds of a window with these loads.serviceEach resource’s service time for these loads: requests, bytes, cores and memory.pricesThe prices of loads near l : the chain rule through the three maxima of T , with each maximum split smoothly by share so a resource that is about to bind already carries part of the price.to_bytesThe cost model as bytes: a magic, its fields (as plan files embed them) and a checksum.from_bytesReads CostModel::to_bytes . The values are not checked against a graph; compilation does that.
Methods and associated constants
defaults
Default costs (see crate::opt::defaults) for a loader whose workers run on cores physical cores, reading storage of tier, with builtin[k] telling whether schema k is the built-in output.
seconds
Modeled seconds of a window with these loads.
service
Each resource’s service time for these loads: requests, bytes, cores and memory.
prices
The prices of loads near l: the chain rule through the three maxima of T, with each maximum split smoothly by share so a resource that is about to bind already carries part of the price.
to_bytes
The cost model as bytes: a magic, its fields (as plan files embed them) and a checksum.
from_bytes
pub fn from_bytes(bytes: &[u8]) -> Result<Self>Reads CostModel::to_bytes. The values are not checked against a graph; compilation does that.
Implemented traits
impl<'de> Deserialize<'de> for CostModelContract reference
See the module reference for semantic input/output rules, units, allocation, mutation, failure behavior, and lifetime requirements. Declarations and documented members are synchronized from the crate source.