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 lines.map(*.Int).sum

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

  seq 100 | time perl6 -e 'slurp.split("\n")>>.Int.sum.say'
5050
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.

marc

Reply via email to