develooper Front page | perl.perl6.users | Postings from September 2019

Re: anything faster than say [+] lines?

Thread Previous | Thread Next
Elizabeth Mattijsen
September 28, 2019 11:11
Re: anything faster than say [+] lines?
Message ID:

> On 28 Sep 2019, at 10:40, Marc Chantreux <> 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'''*.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


which would come back instantaneously, regardless of the size of the range.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About