Do you know where your variables are? | |
PerlMonks |
Re^5: Combining Ultra-Dynamic Files to Avoid Clustering (Ideas?)by davido (Cardinal) |
on Jul 24, 2004 at 06:15 UTC ( [id://377092]=note: print w/replies, xml ) | Need Help?? |
If speed meant NOTHING you'd do it by hand.
The point is that inserting into a flat file means rewriting the entire file each time, unless you store updates and do them in groups. Imagine, if your 2mb flat file grows by 4 bytes each iteration, you're moving around 2mb of data each time you try to add 4 bytes. That's a 2,000,000 bytes of data reading and rewriting for each 4 byte insertion. Speed has got to mean something. I think your solution may be a good one. If building up the dataset is a one-time deal, do it in a database, and then transfer the completed product to a flat file where it can be read quickly.
Dave
In Section
Seekers of Perl Wisdom
|
|