Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: printout of large files. loop vs. flush at once

by mbethke (Hermit)
on Apr 18, 2013 at 17:06 UTC ( [id://1029386]=note: print w/replies, xml ) Need Help??

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.
  • Comment on Re: printout of large files. loop vs. flush at once

Log In?

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-06-17 14:31 GMT
Find Nodes?
    Voting Booth?

    No recent polls found

    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.