delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/07/15/13:38:57

X-Recipient: archive-cygwin AT delorie DOT 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 AT cygwin DOT com
From: Eric Blake <ebb9 AT byu DOT 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 DOT 20090714T213944-461 AT post DOT gmane DOT org> <20090715084635 DOT GQ27613 AT calimero DOT vinschen DOT de> <4A5DCFA7 DOT 9020106 AT byu DOT net> <20090715133117 DOT GA25645 AT calimero DOT vinschen DOT de> <loom DOT 20090715T134656-347 AT post DOT gmane DOT org> <20090715144256 DOT GB31834 AT calimero DOT vinschen DOT de>
Mime-Version: 1.0
User-Agent: Loom/3.14 (http://gmane.org/)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT 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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019