Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
gather should batch an eager reify
Just changing the batch size from 1 to 1000 makes a simple gather/take
run twice as fast, even though it's still doing all the continuations.
  • Loading branch information
TimToady committed Aug 19, 2014
1 parent 9a2f3e5 commit e7835e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/GatherIter.pm
Expand Up @@ -20,7 +20,7 @@ class GatherIter is Iterator {
nqp::continuationcontrol(0, $GATHER_PROMPT, -> Mu \c { $state := c; });
}
$state := {
nqp::handle( $block().eager(),
nqp::handle( $block(),
'TAKE', SEQ($takings := nqp::getpayload(nqp::exception()); yield(); nqp::resume(nqp::exception())));
$takings := $SENTINEL; yield();
};
Expand Down Expand Up @@ -49,7 +49,7 @@ class GatherIter is Iterator {
my Mu $rpa := nqp::list();
my Mu $parcel;
my $end = Bool::False;
my $count = nqp::istype($n, Whatever) ?? 1 !! $n;
my $count = nqp::istype($n, Whatever) ?? 1000 !! $n;
while !$end && $count > 0 {
$parcel := $!coro();
#?if parrot
Expand Down

0 comments on commit e7835e9

Please sign in to comment.