Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
File reading efficiency and other surly remarksby Hot Pastrami (Monk) |
on Aug 26, 2000 at 04:50 UTC ( [id://29760]=perlquestion: print w/replies, xml ) | Need Help?? |
Hot Pastrami has asked for the wisdom of the Perl Monks concerning the following question:
Er, hi. It is true that I will weep with joy when the day arrives that I can answer more PerlMonk questions than I post. I'll gnash teeth, rend clothes, and some real Bible-style celebrating will go on. But alas, that day is not today. So... I've seen benchmarks that indicate line-at-a-time file reading is not as efficient as slurping up the whole dad-gum thing into an array and stepping through it... depending on file size. Not hard to believe. So does anyone care to venture a guess (or happen to know) at approximately what file size method B will be more efficient (and quicker, naturally) than method B? Or, am I dead wrong, and one method is ALWAYS more efficient? The idea is to find a listing in a newline-delimited file, pretty standard stuff, really (forgive the sloppy example code): Thanks for any info you've got. Alan "Hot Pastrami" Bellows -Sitting calmly with scissors-
Back to
Seekers of Perl Wisdom
|
|