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

Re: anything faster than say [+] lines?

Thread Previous | Thread Next
Marc Chantreux
September 23, 2019 20:14
Re: anything faster than say [+] lines?
Message ID:
hello liz and Vittore,

> bypassing $*ARGFILES.lines by using $*IN.lines, makes it faster for me than
> using slurp

$*ARGFILES is the correct FH to use when it comes to write unix filters
(as it was in the other examples of the page).

> >     say*.Int).sum

i recently read that >> could help here so i tried

  seq 100 | time perl6 -e 'slurp.split("\n")>>.Int.sum.say'
perl6 -e 'slurp.split("\n")>>.Int.sum.say'  0,21s user 0,03s system 155% cpu 0,151 total

nice ... but when x is ~ 75440 (not always), there is a problem

moar: src/unix/core.c:539: uv__close: Assertion `fd > STDERR_FILENO' failed.
perl6 -e 'slurp.split("\n")>>.Int.sum.say'  0,30s user 0,05s system 135% cpu 0,254 total

anyway: thanks for detailed and useful replies.


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