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()



> As I've noted separately, reading tens of thousands of files even once
> incurs a significant performance penalty.

True, but reading them all once is better than reading them all twice.
I'm trying to break the problem down into small enough changes that we
actually have a chance of implementing them.

> The change I've proposed can eliminate reading them at all.

But not in a way that we can make it the default.  Perhaps you could
propose a set of mount flags to optimize common situations?  We
already have one to avoid the read-for-execute test, perhaps you could
work on an assume-no-symlinks flag?  Then we wouldn't need a custom
make.exe (or any other program).

> 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.

It does, because stat() reads the file twice, once to see if it's a
symlink, and once to see if the executable bit needs to be set.

> >  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().

Right, but others were suggesting a global cache of file bytes.
*That* would introduce race conditions.

--
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]