Skip to content

Commit

Permalink
Make running timing based tests optional - for slow build servers
Browse files Browse the repository at this point in the history
On a build farm like the OpenBuildService, individual VMs may be a lot slower
than typical developer's machines. Measuring elapsed time to find performance
regressions gives unreliable results there, so make it possible to skip such
tests by setting RAKUDO_SKIP_TIMING_TESTS=1 in the environment.
  • Loading branch information
niner committed Nov 21, 2018
1 parent 8854bbd commit 72b896c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions t/08-performance/99-misc.t
@@ -1,6 +1,8 @@
use Test; use Test;


plan 4; my $skip = %*ENV<RAKUDO_SKIP_TIMING_TESTS> ?? 1 !! 0;

plan 4 - $skip;


# https://github.com/rakudo/rakudo/issues/1488 # https://github.com/rakudo/rakudo/issues/1488
{ {
Expand Down Expand Up @@ -28,7 +30,7 @@ plan 4;
"was native .sum $took2 at least 10x as fast as $took1 ({$took1/$took2}x)"; "was native .sum $took2 at least 10x as fast as $took1 ({$took1/$took2}x)";
} }


{ # https://github.com/rakudo/rakudo/issues/1740 unless $skip { # https://github.com/rakudo/rakudo/issues/1740
my $t-plain = { (^∞).grep(*.is-prime)[1000]; now - ENTER now }(); my $t-plain = { (^∞).grep(*.is-prime)[1000]; now - ENTER now }();
my $t-hyper = { (^∞).hyper.grep(*.is-prime)[1000]; now - ENTER now }(); my $t-hyper = { (^∞).hyper.grep(*.is-prime)[1000]; now - ENTER now }();
cmp-ok $t-hyper, '', $t-plain*2, cmp-ok $t-hyper, '', $t-plain*2,
Expand Down

0 comments on commit 72b896c

Please sign in to comment.