Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: Faster and more efficient way to read a file vertically -- updated

by Laurent_R (Canon)
on Nov 03, 2017 at 17:59 UTC ( [id://1202715]=note: print w/replies, xml ) Need Help??


in reply to Re: Faster and more efficient way to read a file vertically -- updated
in thread Faster and more efficient way to read a file vertically

million of lines still probably fit in memory.
Maybe. Or maybe not. But why take the chance? Especially with an AoA which has some extra cost. It is so easy to do everything in the first loop, when reading each line. And BTW, it is also probably faster, because using an array of arrays implies copying the data once more.
  • Comment on Re^2: Faster and more efficient way to read a file vertically -- updated

Replies are listed 'Best First'.
Re^3: Faster and more efficient way to read a file vertically -- updated
by Discipulus (Canon) on Nov 03, 2017 at 18:05 UTC
    Yes Laurent_R you are absolutely rigth and probably i gave a dumb answer. I not even looked other's replies carefully before posting: as only excuse i can say i was filling the bathtub.. ;=)

    If data must be accessed more times probably is worth to put into an sqlite db, a char per column and access it via SQL queries. No big memory overhead and super speed.

    L*

    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2024-04-24 22:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found