estimate_bytes

Function estimate_bytes 

Source
pub fn estimate_bytes(ty: &Ty, types: &BTreeMap<Arc<str>, TyDecl>) -> Cost
Expand description

Estimate the wire size of a value of this type — §3.4’s “bytes estimated from row types”.

An estimate, and deliberately a crude one: what a placement decision needs is the ratio between a Map[Id, Todo] and an Int, not a byte count. ASSUMED_CARDINALITY is the one place a guess is made about data the compiler cannot see, and it is named so that it can be argued with rather than discovered.