pub struct Tally {
pub records: u64,
pub skipped: u64,
pub bytes: u64,
pub padding: u64,
pub uniform: u64,
pub mixed: u64,
pub blank: u64,
}Expand description
How the bytes of some records fall into granules.
Everything here counts, so two tallies add, and the whole translation unit is the sum of its records.
Fields§
§records: u64How many records were measured.
skipped: u64How many were too large to measure and were skipped.
bytes: u64How many bytes those records occupy in total.
padding: u64How many of those bytes have no effective type, meaning padding.
uniform: u64Granules whose typed bytes all agree, which cost one entry.
mixed: u64Granules whose typed bytes do not, which cost an entry and a sixteen byte side table.
blank: u64Granules with no typed bytes at all, which are padding to the end of the record.
Implementations§
Source§impl Tally
impl Tally
Sourcepub fn disagreeing(&self) -> f64
pub fn disagreeing(&self) -> f64
The fraction of granules that need a side table, which is question 6’s h.
A blank granule needs no side table, so it counts as agreeing here even though nothing in it agrees about anything. Zero granules gives zero, because a translation unit that declares no records puts no pressure on the budget.
Sourcepub fn ratio(&self, granule: u64) -> f64
pub fn ratio(&self, granule: u64) -> f64
Bytes of type plane per byte of program, under document 05’s compression.
One four byte entry per granule, plus a four byte per-byte side table over the whole
granule for the ones that need one, so it is 4/g + 4h and the granule size only
touches the first term. Tier D’s budget is 1.25 and the uncompressed plane is 4, which
is also what this returns at a granule of one byte, since nothing disagrees with itself.