delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/02/13/15:08:15

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Date: 13 Feb 2001 14:46:12 -0500
Message-ID: <20010213194612.17311.qmail@lizard.curl.com>
From: jik-cygwin AT curl DOT com
To: dj AT delorie DOT com
CC: cygwin AT cygwin DOT 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 DOT 3 DOT 1 DOT 2 DOT 20010213134821 DOT 019a7130 AT pop DOT ma DOT ultranet DOT com> <20010213190131 DOT 14369 DOT qmail AT lizard DOT curl DOT com> <200102131935 DOT OAA09136 AT envy DOT delorie DOT com>

>  Date: Tue, 13 Feb 2001 14:35:08 -0500
>  From: DJ Delorie <dj AT delorie DOT 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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019