X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:date:from:to:subject:message-id:reply-to
	:references:mime-version:content-type:in-reply-to; q=dns; s=
	default; b=nwnikoBCvdQMyhPDAr0+98f+wkSO185+5F2sq2z1luyXtXbfy6t/B
	i1oRHOwlXnFMPdpxS+4vsHbGXAILm7M8w1zA9DCl9C7nitZ+jeBKElGFvgsMtVk5
	hXqHajRmM0uHE3hCO0h66Lck2JidRdTWWet8avcDR1ggxiaK/Qx0kU=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:date:from:to:subject:message-id:reply-to
	:references:mime-version:content-type:in-reply-to; s=default;
	 bh=UT8u0+SHAEPi1xRjfhpAGO+pXHE=; b=S7/1t8hWCdVOpiPMwpxT7E+c/977
	oIyO/QPT/TbsXTubLXgcQpUibWc/mBTcWYfn8zf0z/Z0xNxhg4nGhYLLzW3EEtn0
	N1UIkOkmm9A70BSr2PiHyo/sZdKsvVrHhzNiuBBvgjCDs4e1IvGJLp2PP7T/RnKr
	ehVmXSLwKBuhUso=
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
X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.1
Date: Tue, 11 Jun 2013 17:09:36 +0200
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: [PATCH] Check for existence of the path before processing '..'
Message-ID: <20130611150936.GC9484@calimero.vinschen.de>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <001401ce66a4$bb9029a0$32b07ce0$%fedin@samsung.com> <20130611142002.GA1927@ednor.casa.cgf.cx> <20130611150446.GB9484@calimero.vinschen.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <20130611150446.GB9484@calimero.vinschen.de>
User-Agent: Mutt/1.5.21 (2010-09-15)

On Jun 11 17:04, Corinna Vinschen wrote:
> On Jun 11 10:20, Christopher Faylor wrote:
> > On Tue, Jun 11, 2013 at 05:08:13PM +0400, Fedin Pavel wrote:
> > > Hello!
> > >
> > > Some time ago i reported ability to access things like
> > >"/usr/nonexistent/..bin". I still had this problem and i tried my hands on
> > >fixing it.
> > > The patch works by checking the actual existence of the path before
> > >removing the last component from it. For performance reasons, only one check
> > [...]
> > Also you are calling path_conv recursively.  I assume that is where you
> > are seeing a performance hit.
> 
> I don't see how do this without calling path_conv, though.  You have to
> perform the full conversion on the parent path, with symlinks and
> everything to get the right result.
> 
> However, I'm rather impressed by the low impact of this change.  I moved
> the check_parent setting so it's only set when a slash occurs, and then
> I made a couple of runs building coreutils.  As you know, GCC uses ..
> paths a lot.  The performance hit is almost unnoticable:  72.3 seconds
> without, 73.4 seconds with the patch.

Ouch, I computed 2 minutes as 60 seconds here :-P

Correctly computed it's even more impressive: 132.3 secs without, 133.4
secs with the patch.  These are average numbers over 5 runs each.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

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

