mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
8d10056aff
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>