in reply to Re^3: Switch/case (given/when) in Perl5
in thread Switch/case (given/when) in Perl5
Your implication that 5.8.x does no optimizations that look beyond the current opcode is incorrect, or at least completely misleading. It would be more correct to say that it limits itself to optimizations on the current subtree and nearby opcodes. But it is correct insofar as it describes the idea that Perl 5 avoids expensive optimizations in the interests of starting up faster. Code movement optimizations tend to be expensive. (The switch optimization is not in fact such an expensive optimization, roughly O(n), I think, since it's scanning for linear consistency, and inserting an extra jump table opcode if it finds such a consistency. There are no stages where it compares everything against everything else.)
Anyway, if the switch optimization is so important to you that you are willing to sit there and snipe as AM, maybe you should add it yourself. :-)
|
|---|