Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Dear Perl Monks,
I'm retrieving large amount of data from a server and after some preprocessing I'm saving it locally in a text file (~3GB). Each time I'm processing a small chunk and I'm wondering if it's better to print the chunk straight after processing, print only let's say after 10 000 chunks (out of ~70,000) or perhaps store them all and print all at once? Speed is the most important part, thought I'm not sure if creating a 3GB array would be wise.
In regards to the data the chunk is split into hundreds of lines. the first line is an identifier and the rest should all by concatenated. I've used split by newline and then .= for that but perhaps join would be better? Or split with a limit of 2 and then use s/\n//g/ on the second part? Again speed is crucial.
Thanks for all the advice.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Print in loop or store and print once done
by kcott (Archbishop) on Feb 08, 2014 at 00:59 UTC | |
by Anonymous Monk on Feb 08, 2014 at 14:01 UTC | |
|
Re: Print in loop or store and print once done
by Laurent_R (Canon) on Feb 08, 2014 at 00:05 UTC | |
by Anonymous Monk on Feb 08, 2014 at 14:02 UTC | |
|
Re: Print in loop or store and print once done (bench)
by Anonymous Monk on Feb 07, 2014 at 21:49 UTC | |
|
Re: Print in loop or store and print once done
by Kenosis (Priest) on Feb 07, 2014 at 21:20 UTC | |
by Anonymous Monk on Feb 08, 2014 at 14:03 UTC |