Thank you - this is excellent. You have confirmed my suspicion that my tests were not good. Now I need to find a test that tricks the optimizer. Given that the ex-stringify sK/1 ->a op was removed, I guess using constant strings is not the way to test.
I always understood that 'abc' was better than "abc", because of the interpolation, but it seems that the optimizer sees through this, given the constant strings, so all I am doing is being kinder to the optimizer. Premature optimization.
The following now uses a string read from <>, and therefore not a constant:
I'll recreate tests based on this. Thank you all.% perl -MO=Concise my $s=<>; my $t="$s"; b <@> leave[1 ref] vKP/REFC ->(end) 1 <0> enter ->2 2 <;> nextstate(main 1 -:1) v ->3 - <1> null vKS/2 ->6 3 <0> padsv[$s:1,3] sRM*/LVINTRO ->4 5 <1> readline[t3] sKS/1 ->6 4 <#> gv[*ARGV] s ->5 6 <;> nextstate(main 2 -:2) v ->7 a <2> sassign vKS/2 ->b 8 <@> stringify[t5] sK/1 ->9 - <0> ex-pushmark s ->7 7 <0> padsv[$s:1,3] s ->8 9 <0> padsv[$t:2,3] sRM*/LVINTRO ->a
In reply to Re: Re: String Concatenation Performance
by pbeckingham
in thread String Concatenation Performance
by pbeckingham
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |