Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@sources.redhat.com>
List-Help: <mailto:cygwin-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@sources.redhat.com
Delivered-To: mailing list cygwin@sources.redhat.com
Date: 13 Feb 2001 14:46:12 -0500
Message-ID: <20010213194612.17311.qmail@lizard.curl.com>
From: jik-cygwin@curl.com
To: dj@delorie.com
CC: cygwin@cygwin.com
In-reply-to: <200102131935.OAA09136@envy.delorie.com> (message from DJ Delorie
	on Tue, 13 Feb 2001 14:35:08 -0500)
Subject: Re: Optimizing away "ReadFile" calls when Make calls stat()
References: <4.3.1.2.20010213134821.019a7130@pop.ma.ultranet.com> <20010213190131.14369.qmail@lizard.curl.com> <200102131935.OAA09136@envy.delorie.com>

>  Date: Tue, 13 Feb 2001 14:35:08 -0500
>  From: DJ Delorie <dj@delorie.com>
>  
>  I think an easier win would be to cache the bytes read within the
>  fhandler, not globally, so while each fhandler (i.e. open, stat,
>  whatnot) would still need to read the file itself, it would never need
>  to read it more than once.

As I've noted separately, reading tens of thousands of files even once
incurs a significant performance penalty.  The change I've proposed
can eliminate reading them at all.

>  If we still need more performance, perhaps a one-entry cache of the
>  most recent file accessed (and when) could be added, and ignored if
>  the data is more than, say, one second old.  Even if it were local to
>  one process, it would hit most of the usual cases (stat a file, alloc
>  a buffer, then open/read the file).

But it does nothing at all for the "usual case" I'm trying to
optimize, which is Make stat()ing a file but never reading it.

>  These should be easier wins (thus, more doable) than a global cache,
>  which NT should be providing itself as part of the disk cache
>  subsystem (for local drives, at least).  I don't think it's
>  appropriate for cygwin to go beyond this anyway - too many race
>  conditions arise.

As far as I know, there are no race conditions in the change I
suggested.  In fact, it *removes* race conditions, since it reduces
the number of distinct OS operations that must be performed on a file
during stat().

  jik

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

