does this also explain why using a normal @array variable is faster than a constant list?No. That's because constant arrays are implemented as constant array refs. So
is implemented roughly asuse constant foo qw(a b c); @a = $h{foo()}
And neither (as far as I'm aware) get the compile-time HEK treatmentuse constant foo [qw(a b c)]; @a = $h{@{foo()}}
Dave.
In reply to Re^3: Benchmark: Constant List in Hash Slice
by dave_the_m
in thread Benchmark: Constant List in Hash Slice
by LanX
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |