# "Measure first: jennifer profile": two loops of 20,000 rounds; the profile# names line 9. Run: jennifer profile concat.juse io;
use strings;
def n asintinit20000;
def out asstringinit"";
for (def i in0..$n) {
$out = $out + "line\n"; # copies all of $out, every round
}
def lines aslistofstringinit [];
for (def i in0..$n) {
$lines[] = "line"; # grows in place: amortised O(1)
}
def joined asstringinitstrings.join($lines, "\n") + "\n";
io.printf("%d %d same: %v\n", len($out), len($joined), $out == $joined);