These would both allocate arrays. This switches to opt_reverse
with either pop or putnil:
pop
opt_reverse(2)
putnil
opt_reverse(3)
This avoids an unnecessary array allocation, and results in a 35-76%
performance increase in these types of unbalanced cases (tested with
benchmark/masgn.yml).
Expand newarray/expandarray optimization for unequal operands
This optimizes unbalanced multiple assignment cases such as:
Previously, this would use:
These would both allocate arrays. This switches to opt_reverse
with either pop or putnil:
This avoids an unnecessary array allocation, and results in a 35-76%
performance increase in these types of unbalanced cases (tested with
benchmark/masgn.yml).