Ruby’s new hash layout cuts memory use for small tables
Ruby 4 replaces the traditional pointer‑heavy hash with an array‑based layout for small tables and a tighter open‑addressing scheme, halving per‑hash overhead from 160 bytes to about 80 bytes for hashes up to eight entries. The change trims memory use 2‑4× versus structs, boosting copy‑on‑write efficiency and letting Ruby services handle more load on the same RAM.