> On 28 Sep 2019, at 10:40, Marc Chantreux <e...@phear.org> wrote:
>
> hello,
>
>> though that works here, admittedly, my p6 is sort old
>> This is Rakudo version 2018.03 built on MoarVM version 2018.03
>> implementing Perl 6.c.
>
> this lead me test it with the docker rakudo-star (2019.03).
>
> time docker run rakudo-star bash -c 'seq 100000000|
> perl6 -e ''slurp.split("\n")>>.Int.sum.say'''
slurp.lines.map(*.Int).sum.say
should make it a bit faster, at the expense of *much* more memory usage, as
opposed to just.
In any case, to get the same result, you could also do
(0..10_000_00).sum.say
which would come back instantaneously, regardless of the size of the range.