# New Ticket Created by Aleks-Daniel Jakimenko-Aleksejev
# Please include the string: [perl #132306]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/Ticket/Display.html?id=132306 >
Code:
sub f1($a, $, $, $, $, $) { 1 };
my $s;
$s += f1($_, $_, $_, $_, $_, $_) for ^1_000_000;
say now - BEGIN now
Result:
0.43209886
Code:
sub f2($a, $b1, $b2, $b3, $b4, $b5) { 1 };
my $s;
$s += f2($_, $_, $_, $_, $_, $_) for ^1_000_000;
say now - BEGIN now
Result:
0.6635439
None of the params are used but still replacing them with just $ makes things
run faster.
The difference is measurable and you can increase the number of loops to
observe it even better.
This ticket is motivated by a pull request which used that observation to speed
things up in rakudo: https://github.com/rakudo/rakudo/pull/1196
This is Rakudo version 2017.09-375-ga0f29e0df built on MoarVM version
2017.09.1-594-gb9d3f6da
implementing Perl 6.c.