On Tue, Mar 29, 2016 at 10:29 PM, Timo Paulssen <[email protected]> wrote: > On 03/30/2016 03:45 AM, Timo Paulssen wrote: > > Could you try using $filename.IO.slurp.lines instead of $filename.IO.lines > and see if that makes things any faster? > - Timo > > > Actually, the method on an IO::Handle is called "slurp-rest"; slurp would > only work with a filename instead. > - Timo
Okay, I've done a comparison of the three methods on a 1 Gb file: IO.lines real 2m11.827s user 2m10.036s sys 0m1.468s IO.split real 1m51.504s user 1m51.136s sys 0m0.352s IO.slurp-rest real 2m9.821s user 2m6.268s sys 0m3.532s and Perl 5: real 0m4.614s user 0m4.328s sys 0m0.280s Best, -Tom
