This is the mail archive of the cygwin-patches@cygwin.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]
Other format: [Raw text]

Re: [PATCH] improve performance of stat() operations (e.g. ls -lR )


On Sun, May 26, 2002 at 08:08:02PM -0400, Don Bowman wrote:
>Christopher Faylor wrote:
>>On Sun, May 26, 2002 at 05:50:13PM -0400, Don Bowman wrote:
>>>
>>>The attached patch adds a new CYGWIN environment variable, statquery. 
>...
>
>>You should get the same effect by mounting directories or files with
>>either the -E or -X option.  And, the control is more pinpoint than an
>>environment variable.
>
>Nope. The behaviour comes from the NT CreateFile() operation, as
>observed with ntfilemon (from www.sysinternals.com). That single
>system call opens the file, reads a bunch of (random) data from
>different offsets. Neither the -E nor the -X to mount has 
>any affect on this.
>
>For interests sake, here's a (non-scientific :) benchmark:
>The cygwin source code (cvs co winsup) ls -lR takes:
>
>57.171s (default options)
> 4.462s (new 'statquery' option)
>44.002s (mount -E option)
>45.171s (mount -X option)
>
>each run was done twice, and the 2nd number taken (to avoid system 
>issues)
>
>You are perhaps correct that making this a mount option rather than
>an env variable would be a good way to go. Its not clear to me why 
>the file is being opened for read during that stat anyway.

Hmm.  Interesting.  It seems like -E and -X should just be defaulting
to doing query_open.  I think that the only reason that query_open
is not the default is that the file has to be opened for reading if
the executable state is not known.

Or, maybe it's actually possible not to do an open at all in those
cases.

Hmm, again.

cgf


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