This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Optimizing away "ReadFile" calls when Make calls stat()


>  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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]