in reply to printout of large files. loop vs. flush at once
Perl I/O is buffered unless you say otherwise, so what actually hits the disk (or rather the OS, which may do its own buffering) are usually blocks of ~4k anyway. On local disks 4k isn't usually very slow but as you're talking about a file server, I suppose there's some network in between your application and the disk. With their much higher latencies network file systems tend to have bigger differences between writing small and big blocks so it could be worth it. The only way to find out is to benchmark---just slurp a big text file into an array and then try how long it takes either way before you change all the printing in a non-trivial program.
|