in reply to non schlemiel painter string concat
You don't really need to worry about it, because perl's concatenation operator is optimized for that.
use Time::HiRes qw( time ); for my $exp (3 .. 8) { my $count = 10**$exp; my $start = time(); my $x = ''; for (1 .. $count) { $x .= 'x'; } printf "%d %.5f\n", $count, time() - $start; }
1000 0.00012 10000 0.00113 100000 0.01161 1000000 0.11535 10000000 1.09300 100000000 11.02793
|
|---|