Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 31 lines (27 sloc) 1.063 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
my @numbers = 1..300, 10000..10300;
my $rakudo = "perl6";
my $niecza = "mono ../niecza/run/Niecza.exe";

sub MAIN(*@scripts) {
    my %rakudo-results;
    my %niecza-results;
    for @scripts -> $script {
        my $start = now;
        qqx/$rakudo $script { @numbers }/;
        my $end = now;
        %rakudo-results{$script} = ($end - $start).round(1/10);

        next if $script ~~ /cached/ && $script !~~ /"hand-cached"/;
        
        $start = now;
        qqx/$niecza $script { @numbers }/;
        $end = now;
        %niecza-results{$script} = ($end - $start).round(1/10);
    }

    say '<table border="1" align="center"> <tr><td>Script</td><td>Rakudo</td><td>Niecza</td></tr>';
    for %rakudo-results.pairs.sort(*.value) -> (:key($script), :value($time)) {
        say "<tr>";
        say " <td> <a href=\"https://github.com/colomon/perl6-collatz/blob/master/$script\"> $script </a> </td>";
        say " <td> $time </td>";
        say " <td> { %niecza-results{$script} // "N/A" } </td>";
say "</tr>";
}
say "</table>";
}
Something went wrong with that request. Please try again.