Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- Skip timing of undefined (untranslatable) tests
- Rejigger a couple old tests to be more equivalent and better named
- Add a couple new tests based on harbud3's comments on reddit:
  http://www.reddit.com/r/perl/comments/12vtbw/i_know_python_very_well_is_there_any_reason_i/c716bke
  • Loading branch information
Geoffrey Broadwell committed Nov 22, 2012
1 parent eb1c2d7 commit 82d7b0f
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions timeall
Expand Up @@ -187,16 +187,28 @@ my %TESTS = (
nqp => 'say("Hello, World!")',
},
{
name => 'empty_loop_1e5',
perl5 => '1 for 1 .. 100000',
perl6 => '1 for 1 .. 100000',
nqp => 'my $i := 1; while $i <= 100000 { $i := $i + 1; 1 }',
name => 'empty_while_1e5',
perl5 => 'my $i = 1; while (++$i <= 100000) { }',
perl6 => 'my $i = 1; while (++$i <= 100000) { }',
nqp => 'my $i := 1; while ($i := $i + 1) <= 100000 { }',
},
{
name => 'empty_loop_1e6',
perl5 => '1 for 1 .. 1000000',
perl6 => '1 for 1 .. 1000000',
nqp => 'my $i := 1; while $i <= 1000000 { $i := $i + 1; 1 }',
name => 'empty_while_1e6',
perl5 => 'my $i = 1; while (++$i <= 1000000) { }',
perl6 => 'my $i = 1; while (++$i <= 1000000) { }',
nqp => 'my $i := 1; while ($i := $i + 1) <= 1000000 { }',
},
{
name => 'for_concat_1e5',
perl5 => 'my $s = ""; for (1 .. 100000) { $s .= "x" }',
perl6 => 'my $s = ""; for (1 .. 100000) { $s ~= "x" }',
nqp => undef,
},
{
name => 'for_push_1e3',
perl5 => 'my @a; for (1 .. 1000) { push @a, 1 }',
perl6 => 'my @a; for (1 .. 1000) { push @a, 1 }',
nqp => undef,
},
],
f => [
Expand Down Expand Up @@ -355,7 +367,7 @@ sub time_group {
my $dir = $perl->{dir} || 'BENCH';
my $comp = $perl->{"${test_type}_compile"} || [];
my $run = $perl->{"${test_type}_run"};
my $args = $opt->{$group_name};
my $args = $opt->{$group_name} // next;
my @args = ref $args ? @$args : ($args);

s/\bBENCH\b/$FindBin::Bin/g for $dir, @$comp, @$run, @args;
Expand Down

0 comments on commit 82d7b0f

Please sign in to comment.