Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^5: Making this script process 56,000 lines 5 times faster

by LanX (Saint)
on Mar 22, 2018 at 18:58 UTC ( [id://1211562]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Making this script process 56,000 lines 5 times faster
in thread Making this script process 56,000 lines 5 times faster

Actually your original approach in the OP with for( split ...) had this problem.

The while(m/.../) here is an iterator, you could operate with a sliding window to read consecutive chunks into memory, and adjust with pos where you left of.

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Wikisyntax for the Monastery

Replies are listed 'Best First'.
Re^6: Making this script process 56,000 lines 5 times faster
by kris004 (Initiate) on Mar 22, 2018 at 19:03 UTC

    Ah ok, thanks!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1211562]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2024-04-19 20:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found