Alias allocation order
A v4 type file whose record alternates F and G over six fields. The input lists the fields as rebate, base,
bonus, extra, fee, gain, so F comes first in the input; first use is measured in the written form, which
sorts the fields as base, bonus, extra, fee, gain, rebate.
Occurrences in first-use order.
- G (
fqNames) atbase,extraandgain, O = 88 each. Ida: S = 3 × (88 − 13) = 225; E = 1 + 86 + 6 = 93. 225 > 93: aliased asa. - F (
fqNames) atbonus,feeandrebate, O = 101 each. Idb: S = 3 × 88 = 264 > E = 106: aliased asb. order-total(names), once. Tentative idc: S = 0 ≤ E = 18, spelled out.
Loss decision. Two entries in fqNames: overhead = 118 + 12 + (1 + 86 + 5) + (1 + 99 + 5) + (2 − 1) = 328.
Savings 225 + 264 = 489 > 328, so the envelope is written, 161 bytes smaller: 758 bytes plain, 597 bytes compacted.
Allocating by input order would have named F a; the bytes would differ.