Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Date: Mon, 6 Jun 2005 14:13:53 +0200
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: performance problems
Message-ID: <20050606121353.GH3268@calimero.vinschen.de>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <4297A14B.9070409@plausible.org> <20050528131501.V53507@logout.sh.cvut.cz> <20050528160424.GB12395@trixie.casa.cgf.cx> <429ED094.9080001@tlinx.org> <Pine.GSO.4.61.0506021301320.10282@slinky.cs.nyu.edu> <429FAA40.1050707@tlinx.org> <429FB310.F17D2674@dessent.net> <20050606093101.GD3268@calimero.vinschen.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20050606093101.GD3268@calimero.vinschen.de>
User-Agent: Mutt/1.4.2i

On Jun  6 11:31, Corinna Vinschen wrote:
> On Jun  2 18:32, Brian Dessent wrote:
> > In order to implement stat(), cygwin has to call NtQueryInformationFile
> > (GetFileInformationByHandle for 9x/me) and this requires the file to be
> > opened.  Thus the reason that stat takes forever is that each file has
> 
> There would be a theoretical way around this.  NtQueryDirectoryFile allows
> to get all information about a file (with a prominent exception) without
> having to open the file.  Instead you just need the handle to the parent
> directory.  We don't have the infrastructure in Cygwin right now to use
> this method easily, but it could speed up stat when, for instance, the file
> is in the current working directory or if the process has called opendir on
> the parent directory of the file.

Further testing of the NtQueryDirectoryFile function shows that it's not
usable as I imagined.  If you want to retrieve information about a single
file without disturbing the current opendir/readdir, it's necessary to
open the directory again.  The directory handle used in the current
opendir/readdir is not usable for this purpose.  Neither is a duplicated
handle of it.  Oh boy.

Looks like the only useful way to use it is caching the results.  As far
as that's useful.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          mailto:cygwin@cygwin.com
Red Hat, Inc.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

