Skip to content

Commit

Permalink
Cover hyper.grep perf regression
Browse files Browse the repository at this point in the history
Closes rakudo/rakudo#1740 R#1740
  • Loading branch information
zoffixznet committed Apr 18, 2018
1 parent a25af14 commit 9a6b6b6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion S07-hyperrace/stress.t
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 10;
plan 11;

{
my @seq = (^20000).grep(*.is-prime);
Expand Down Expand Up @@ -36,3 +36,10 @@ plan 10;
my @hyper = (^1000).hyper.map({ slip('x' xx $_) }).map(*.item);
is @hyper.elems, @seq.elems, 'Correct number of elements from hyper map with slip';
}

{ # https://github.com/rakudo/rakudo/issues/1740
my $t-plain = { (^∞).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,
'hypered .grep .is-prime is not hugely slower than plain grep';
}

0 comments on commit 9a6b6b6

Please sign in to comment.