X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-3.6 required=5.0 	tests=BAYES_00,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS
X-Spam-Check-By: sourceware.org
To: cygwin@cygwin.com
From: Eric Blake <ebb9@byu.net>
Subject:  Re: [1.7] bug in chdir
Date: Wed, 15 Jul 2009 17:38:26 +0000 (UTC)
Lines: 60
Message-ID:  <loom.20090715T145506-392@post.gmane.org>
References:  <loom.20090714T213944-461@post.gmane.org> <20090715084635.GQ27613@calimero.vinschen.de> <4A5DCFA7.9020106@byu.net> <20090715133117.GA25645@calimero.vinschen.de> <loom.20090715T134656-347@post.gmane.org> <20090715144256.GB31834@calimero.vinschen.de>
Mime-Version:  1.0
Content-Type:  text/plain; charset=us-ascii
Content-Transfer-Encoding:  7bit
User-Agent: Loom/3.14 (http://gmane.org/)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
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

Corinna Vinschen <corinna-cygwin <at> cygwin.com> writes:

> I created a patch which uses WNetOpenEnum for the existence check, but
> it needs extremly long to timeout the existence check in such a case.

There's already a long timeout on unknown names; that's inescapable when 
dealing with // issues.  Without the patch:

$ time dash -c 'cd //bin'
cd: 1: can't cd to //bin

real	0m6.921s
user	0m0.046s
sys	0m0.015s

$ time dash -c 'cd //home' # wrong result

real	0m0.187s
user	0m0.030s
sys	0m0.030s

$ time dash -c 'cd //eblake'

real    0m0.031s
user    0m0.030s
sys     0m0.015s



With the patch, I see:

$ time dash -c 'cd //bin'
cd: 1: can't cd to //bin

real    0m4.796s
user    0m0.030s
sys     0m0.030s

$ time dash -c 'cd //home' # right result
cd: 1: can't cd to //home

real    0m0.031s
user    0m0.030s
sys     0m0.015s

$ time dash -c 'cd //eblake'

real    0m0.031s
user    0m0.030s
sys     0m0.015s


So, no obvious speed regression on good paths, a whopping 25% performance 
improvement on paths that previously failed, and the desired failure on the 
questionable path is now achieved with speed comparable to the success path!  
I'd say go ahead and apply the patch - the numbers speak for themselves.

-- 
Eric Blake



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

