Files
mruby-mruby/include
Yukihiro "Matz" Matsumoto 8d10056aff variable.c: add object shapes for MRB_TT_OBJECT IV storage
Introduce "object shapes" (hidden classes) that share IV key
layouts across objects with the same instance variable assignment
order. This eliminates per-object key storage overhead.

Memory savings: ~22% heap reduction for object-heavy workloads
(e.g., 150k objects with 2-6 IVs). Per-object: 40->24 bytes
for 2 IVs. Objects exceeding 16 IVs or using
remove_instance_variable fall back to traditional iv_tbl.

Co-authored-by: Claude <noreply@anthropic.com>
2026-02-27 08:29:46 +09:00
..