in reply to Re: String Concatenation Performance
in thread String Concatenation Performance

Oh I agree completely - there is not much to be gained here, but in general, I still want to know the degree to which interpolation is slower. My problem is all about isolating test cases that show this. For example, the following are all going to perform slightly differently, and I just want to understand:

print "$a$b$c\n"; print $a, $b, $c, "\n";
or how about:
my $s = $a . $b . $c . "\n"; my $s = "$a$b$c\n";

Replies are listed 'Best First'.
Re: Re: Re: String Concatenation Performance
by TimToady (Parson) on Mar 20, 2004 at 23:13 UTC
    Your first pair can be significantly different, depending on the relative performance of concatenation vs your I/O system. However, your second pair should always be identical, statistically speaking. They always compile down to identical opcodes, as chromatic pointed out. There's no point in comparing them to see which one is faster, because you're pretty much guaranteed not to get a statistically signicant difference, and if you ever do, you didn't. :-)