develooper Front page | perl.beginners | Postings from December 2002

Re: file into memory

Thread Previous | Thread Next
Jenda Krynicky
December 29, 2002 09:50
Re: file into memory
Message ID:
> On Tue, Dec 24, 2002 at 10:44:29AM -0800, R. Joseph Newton wrote:
> > Really?  In that case, you may be vastly underestimating the cost of
> > I/O on performance.  Bear in mind that memory has a responce time in
> > the 10- ns range, while disk accesses range in the milliseconds,
> > while your process goes into the wait queue.  There is every reason
> > in the world to seek to bring in the maximum usable data with each
> > access.
> > Remember: while your logical file pointer may remain fixed,
> > patiently awaiting your next get, the system has moved on, served
> > other users, and may have moved the physical RW head many tracks
> > away.  I think it's a very good rule of thumb to stick to one I/O
> > channel at a time, and to do no more processing during access than
> > is absolutely necessary to ensure data integrity.

While these are good points this is NOT your bussiness!
The OS is responsible for this. And usualy does this pretty well.
It'll do the file access cacheing for you. Slurping data you don't 
need yet is just a waste of memory. Which could easily force the OS 
to start to swap/page and thus degrade the performance.

Unless you run under CP/M or write your own OS you should leave these 
lowlevel concerns to someone else.

IMHO of course, Jenda
===== === =====
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
	-- Terry Pratchett in Sourcery

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About