perl6-bench version bbecc79-dirty (ignoring startup time and compile time)

Toggles
[ Code ]
Perl 6: say "Hello, World!"
NQP: say("Hello, World!")
Perl 5: say "Hello, World!"
[ Code ]
Perl 6: my $i = 0; while (++$i <= SCALE) { }
NQP: my $i := 0; while ($i := $i + 1) <= SCALE { }
Perl 5: my $i = 0; while (++$i <= SCALE) { }
[ Code ]
Perl 6: my int $i = 0; while ($i = $i + 1) <= SCALE { }
NQP: my int $i := 0; while ($i := $i + 1) <= SCALE { }
Perl 5: use integer; my $i = 0; while (++$i <= SCALE) { }
[ Code ]
Perl 6: my $a := 0; my $b := 1; my $i = 0; while (++$i <= SCALE) { $a := $b }
NQP: my $a := 0; my $b := 1; my $i := 0; while ($i := $i + 1) <= SCALE { $a := $b }
Perl 5: use Data::Alias; alias my $a = 0; alias my $b = 1; my $i = 0; while (++$i <= SCALE) { alias $a = $b }
[ Code ]
Perl 6: my $s = ""; my $i = 0; while (++$i <= SCALE) { $s ~= "x" }
NQP: my $s := ""; my $i := 0; while ($i := $i + 1) <= SCALE { $s := $s ~ "x" }
Perl 5: my $s = ""; my $i = 0; while (++$i <= SCALE) { $s .= "x" }
[ Code ]
Perl 6: my str $s = ""; my int $i = 0; while ($i = $i + 1) <= SCALE { $s = $s ~ "x" }
NQP: my str $s := ""; my int $i := 0; while ($i := $i + 1) <= SCALE { $s := $s ~ "x" }
Perl 5: use integer; my $s = ""; my $i = 0; while (++$i <= SCALE) { $s .= "x" }
[ Code ]
Perl 6: my @a; my $i = 0; while (++$i <= SCALE) { @a.push("x") }; my $s; $s = @a.join;
NQP: my @a; my $i := 0; while ($i := $i + 1) <= SCALE { nqp::push(@a, "x"); }; my $s := nqp::join("",@a);
Perl 5: my @a; my $i = 0; while (++$i <= SCALE) { push @a, "x" }; my $s = join "" => @a;
[ Code ]
Perl 6: my @a; my $i = 0; while (++$i <= SCALE) { push @a, 1 }
NQP: my @a; my $i := 0; while ($i := $i + 1) <= SCALE { nqp::push(@a, 1) }
Perl 5: my @a; my $i = 0; while (++$i <= SCALE) { push @a, 1 }
[ Code ]
Perl 6: my @a; my $i = 0; while (++$i <= SCALE) { @a[ $i ] = $i }
NQP: my @a; my $i := 0; while ($i := $i + 1) <= SCALE { @a[ $i ] := $i }
Perl 5: my @a; my $i = 0; while (++$i <= SCALE) { $a[ $i ] = $i }
[ Code ]
Perl 6: my %h; my $i = 0; while (++$i <= SCALE) { %h{ $i } = $i }
NQP: my %h; my $i := 0; while ($i := $i + 1) <= SCALE { %h{ $i } := $i }
Perl 5: my %h; my $i = 0; while (++$i <= SCALE) { $h{ $i } = $i }
[ Code ]
Perl 6: my $i = -SCALE || exit(0); Nil while ++$i;
NQP: my $i := -SCALE || nqp::exit(0); () while $i := $i + 1;
Perl 5: my $i = -SCALE || exit(0); () while ++$i;
[ Code ]
Perl 6: my int $i = -SCALE || exit(0); Nil while $i = $i + 1;
NQP: my int $i := -SCALE || nqp::exit(0); () while $i := $i + 1;
Perl 5: use integer; my $i = -SCALE || exit(0); () while ++$i;
[ Code ]
Perl 6: loop (my $i = 1; $i <= SCALE; ++$i) { }
Perl 5: for (my $i = 1; $i <= SCALE; ++$i) { }
[ Code ]
Perl 6: loop (my int $i = 1; $i <= SCALE; $i = $i + 1) { }
Perl 5: use integer; for (my $i = 1; $i <= SCALE; ++$i) { }
[ Code ]
Perl 6: for (1 .. SCALE) { }; 1
Perl 5: for (1 .. SCALE) { }; 1
[ Code ]
Perl 6: my $a := 0; my $b := 1; for (1 .. SCALE) { $a := $b; }; 1
Perl 5: use Data::Alias; alias my $a = 0; alias my $b = 1; for (1 .. SCALE) { alias $a = $b; }; 1
[ Code ]
Perl 6: my $a = 0; my $b = 1; for (1 .. SCALE) { $a = $b; }; 1
Perl 5: my $a = 0; my $b = 1; for (1 .. SCALE) { $a = $b; }; 1
[ Code ]
Perl 6: my int $a = 0; my int $b = 1; for (1 .. SCALE) { $a = $b; }; 1
Perl 5: use integer; my $a = 0; my $b = 1; for (1 .. SCALE) { $a = $b; }; 1
[ Code ]
Perl 6: my $i = 0; for (1 .. SCALE) { $i++ }; 1
Perl 5: my $i = 0; for (1 .. SCALE) { $i++ }; 1
[ Code ]
Perl 6: my int $i = 0; for (1 .. SCALE) { $i = $i + 1 }; 1
Perl 5: use integer; my $i = 0; for (1 .. SCALE) { $i++ }; 1
[ Code ]
Perl 6: my $s = ""; for (1 .. SCALE) { $s ~= "x" }; 1
Perl 5: my $s = ""; for (1 .. SCALE) { $s .= "x" }; 1
[ Code ]
Perl 6: my str $s = ""; for (1 .. SCALE) { $s = $s ~ "x" }; 1
Perl 5: use integer; my $s = ""; for (1 .. SCALE) { $s .= "x" }; 1
[ Code ]
Perl 6: my $x = "a"; my $y = ""; for (1 .. SCALE) { $y ~= ($x ~ $x) }; 1
Perl 5: my $x = "a"; my $y = ""; for (1 .. SCALE) { $y .= ($x . $x) }; 1
[ Code ]
Perl 6: my str $x = "a"; my str $y = ""; for (1 .. SCALE) { $y = $y ~ $x ~ $x }; 1
Perl 5: use integer; my $x = "a"; my $y = ""; for (1 .. SCALE) { $y .= ($x . $x) }; 1
[ Code ]
Perl 6: my @a; for (1 .. SCALE) { push @a, 1 }; 1
Perl 5: my @a; for (1 .. SCALE) { push @a, 1 }; 1
[ Code ]
Perl 6: my @a; @a[ $_ ] = $_ for 1 .. SCALE
Perl 5: my @a; $a[ $_ ] = $_ for 1 .. SCALE
[ Code ]
Perl 6: my %h; %h{ $_ } = $_ for 1 .. SCALE
Perl 5: my %h; $h{ $_ } = $_ for 1 .. SCALE
[ Code ]
Perl 6: [+] 1 .. SCALE
Perl 5: use List::Util "reduce"; reduce { $a + $b } 1 .. SCALE
[ Code ]
Perl 6: [+] (1 .. SCALE).comb>>.Int
Perl 5: use List::Util "reduce"; reduce { $a + $b } map { 0+$_ } map { split "" } 1 .. SCALE
[ Code ]
Perl 6: 1 == any(1 .. SCALE)
[ Code ]
Perl 6: my $s = " " x SCALE ~ "x" x SCALE ~ " " x SCALE; $s.trim for 1 .. SCALE
Perl 5: my $s = " " x SCALE . "x" x SCALE . " " x SCALE; my ($result) = $s =~ /^\s*(.*?)\s*$/s for 1 .. SCALE
[ Code ]
Perl 6: my $i = 0; while ($i < SCALE) { my $j = 0; while ($j < SCALE) { $i + $j; $j++ }; $i++ }
NQP: my $i := 0; while ($i < SCALE) { my $j := 0; while ($j < SCALE) { $i + $j; $j := $j + 1 }; $i := $i + 1 }
Perl 5: my $i = 0; while ($i < SCALE) { my $j = 0; while ($j < SCALE) { $i + $j; $j++ }; $i++ }
[ Code ]
Perl 6: my int $i = 0; while ($i < SCALE) { my int $j = 0; while ($j < SCALE) { $i + $j; $j = $j + 1 }; $i = $i + 1 }
NQP: my int $i := 0; while ($i < SCALE) { my int $j := 0; while ($j < SCALE) { $i + $j; $j := $j + 1 }; $i := $i + 1 }
Perl 5: use integer; my $i = 0; while ($i < SCALE) { my $j = 0; while ($j < SCALE) { $i + $j; $j++ }; $i++ }
[ Code ]
Perl 6: loop (my $i = 0; $i < SCALE; $i++) { loop (my $j = 0; $j < SCALE; $j++) { $i + $j } }
Perl 5: for (my $i = 0; $i < SCALE; $i++) { for (my $j = 0; $j < SCALE; $j++) { $i + $j } }
[ Code ]
Perl 6: loop (my int $i = 0; $i < SCALE; $i = $i + 1) { loop (my int $j = 0; $j < SCALE; $j = $j + 1) { $i + $j } }
Perl 5: use integer; for (my $i = 0; $i < SCALE; $i++) { for (my $j = 0; $j < SCALE; $j++) { $i + $j } }
[ Code ]
Perl 6: for ^SCALE -> $i { for ^SCALE -> $j { $i + $j }; 1 }; 1
Perl 5: for my $i (0 .. (SCALE - 1)) { for my $j (0 .. (SCALE - 1)) { $i + $j }; 1 }; 1
[ Code ]
Perl 6: for ^SCALE X ^SCALE -> $i, $j { $i + $j }; 1
[ Code ]
Perl 6: my %h; for ^SCALE { %h{$_} = $_ }; for %h.kv -> $k, $v { $k == $v }; 1
Perl 5: my %h; for (0 .. (SCALE - 1)) { %h{$_} = $_ }; while (my ($k, $v) = each %h) { $k == $v }; 1
[ Code ]
Perl 6: my $r = 1.0; for 1 .. SCALE { $r *= $_; $r /= $_ + 1 }; say $r.perl
Perl 5: use Math::BigRat; my $r = Math::BigRat->new(1); for (1 .. SCALE) { $r *= $_; $r /= $_ + 1 }; say "<$r>"
[ Code ]
Perl 6: my $r = FatRat.new(0, 1); for 1 .. SCALE { $r += 1 / $_ }; say $r.perl
Perl 5: use Math::BigRat; my $r = Math::BigRat->new(0); for (1 .. SCALE) { $r += Math::BigRat->new(Math::BigInt->new(1), Math::BigInt->new($_)) }; say $r