Appearance
cellpack::opt::PlanOptions
Module contract · All interfaces
At a glance
pub struct PlanOptions {
pub cache_bytes: usize,
pub gap: u64,
pub threads: usize,
pub cpus: Vec<usize>,
pub objective: PlanObjective,
pub cost: Option<CostModel>,
pub rows: bool,
pub row_policy: RowPolicy,
pub block_pages: Option<u32>,
pub horizon: Option<u64>,
pub chunk: Option<u64>,
}What a compilation optimizes for: the budget, the reuse gap, the objective and the cost model of one loader on one machine.
Use Loader::plan_options as a starting point. gap and horizon count slots; chunk counts accesses. Cache bytes reserve frames and do not include the entire loader's memory.
Fields and variants
cache_bytes
cache_bytes: usizeCache bytes for planned frames: cache_bytes / page_size frames, the budget the shards split.
gap
gap: u64The reuse gap in slots: the loader’s execution window may not exceed it, and every residency reserves its frames from the same gap in accesses (this many slots times a slot’s accesses) before its admission.
threads
threads: usizeCompiler threads. Decisions depend on the count only through the shard and part split, not on the order the threads take work in.
cpus
Optional compiler CPU set; empty inherits the calling thread’s set.
objective
objective: PlanObjectiveWhether plans minimize modeled time or page misses.
cost
The machine’s costs; without one, every page hit counts the same and only pages are cached.
rows
rows: boolAlso cache rows (page+row mode; needs a cost model, and is off under PlanObjective::Misses).
row_policy
row_policy: RowPolicyHow page+row compilations choose rows.
block_pages
Merge admissions of adjacent pages into reads of at most this many pages where the requests saved are worth more than the frames held longer (needs a cost model).
horizon
The longest reuse interval the compiler considers, in slots: how far past the frozen plan it optimizes, and with it the compiler’s memory (about 30 bytes per access of the horizon). Defaults online to twice the source’s cells in accesses (two epochs when an epoch visits every cell once), which sees every reuse of epoch shuffles. Offline compilations see the whole sequence.
chunk
Accesses the compiler advances, freezes and publishes at a time (default DEFAULT_CHUNK).
Member index
1 of 1 members
newOptions for cache_bytes of cache and reuse gap gap slots, with the default thread count, the time objective, no cost model and page caching only.
Methods and associated constants
new
Options for cache_bytes of cache and reuse gap gap slots, with the default thread count, the time objective, no cost model and page caching only.
Implemented traits
impl Clone for PlanOptionsimpl Debug for PlanOptionsContract 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.