To me it looks like the loop and the string concat are okay-ish (this is on a
"not too beefy" machine (i3 3.33 GHz, 8 GiB RAM):
$ perl6-m -e 'my $file = ""; for ^2 {$file ~= "$_;"};'
real0m0.500s
user0m0.436s
sys 0m0.060s
$ perl6-p -e 'my $file = ""; for ^2 {$file ~= "$_;"};
# New Ticket Created by "Carl Mäsak"
# Please include the string: [perl #120380]
# in the subject line of all future correspondence about this issue.
# https://rt.perl.org/Ticket/Display.html?id=120380 >
Hello. Does anybody tried this on rakudo-jvm? my $file = "";
for ^2 {$file ~= "$_;"}