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

Re: file into memory

Thread Previous | Thread Next
From:
Jenda Krynicky
Date:
December 29, 2002 09:50
Subject:
Re: file into memory
Message ID:
3E0F43F8.26094.2CFE6A66@localhost
> 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
===== Jenda@Krynicky.cz === http://Jenda.Krynicky.cz =====
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


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About