Ruff author squeezes 8 more bytes out of Expression enum (64→56), cutting retained memory by >1%

charliermarsh · x · 2026-09-11

charliermarsh shares a fresh deep optimization in Ruff: shrinking Rust's Expression enum from 64 to 56 bytes by trimming its largest variant, which reduces retained memory by another >1%. A nice illustration of how enum layout work pays off at scale in code-analysis tooling.

Related event: Ruff Author Shrinks Expression Enum to 56 Bytes, Saving 1% Memory(2 posts)→

Original post →

More from coding & agent

coding & agent channel →