• Sources: primary, discussion
  • Summary: Rust's alignment rules pushed a tagged enum whose largest variant needs 64 bits out to a full 128 bits. Replacing it with low-bit tagging in a single 64-bit word cut peak RSS by up to 37 percent and improved every benchmark, including the float-heavy ones the author expected to regress.
  • Why it matters: Enum layout in Rust can silently double a value representation, and the cost shows up as memory traffic rather than as anything visible in the source.

send feedback on this story