Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 61047 invoked from network); 13 Dec 2010 09:16:14 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 13 Dec 2010 09:16:14 -0000 Received: (qmail 12576 invoked by uid 500); 13 Dec 2010 09:16:14 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 12233 invoked by uid 500); 13 Dec 2010 09:16:12 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 12225 invoked by uid 99); 13 Dec 2010 09:16:12 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Dec 2010 09:16:12 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [88.84.128.168] (HELO samaflost.de) (88.84.128.168) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Dec 2010 09:16:04 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by samaflost.de (Postfix) with ESMTP id 085B840E0008 for ; Mon, 13 Dec 2010 10:15:44 +0100 (CET) Received: from samaflost.de ([127.0.0.1]) by localhost (v35516.1blu.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hy7VL5XmXbpU for ; Mon, 13 Dec 2010 10:15:43 +0100 (CET) Received: by samaflost.de (Postfix, from userid 1000) id 5EAA040E0007; Mon, 13 Dec 2010 10:15:43 +0100 (CET) From: Stefan Bodewig To: dev@ant.apache.org Subject: Re: Bug 50200, VectorSet kills the performance of DirectoryScanner References: <4D056C68.3060705@gmx.de> X-Draft-From: ("nnfolder:mail.jakarta-ant" 102023) Date: Mon, 13 Dec 2010 10:15:43 +0100 In-Reply-To: <4D056C68.3060705@gmx.de> (Antoine Levy-Lambert's message of "Sun, 12 Dec 2010 19:44:24 -0500") Message-ID: <87mxoac9ts.fsf@v35516.1blu.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Checked: Checked by ClamAV on apache.org On 2010-12-13, Antoine Levy-Lambert wrote: > Hi, > I got a private email asking me to apply the patch suggested by > *Bug 50200* - [1] > VectorSet kills the performance of DirectoryScanner > The code looks good and I am wondering why we have the current implementation. > Stefan ? I remember I looked at the patch a few weeks ago but ran out of time back then. The reason I didn't commit it right away is that at first glance it seems to make assumptions about the base class's implementation that may or may not be true. At first first I thought that if Vector#add(Object) delegates to Vector#add(int,Object) the suggested implementation would lead to an infinite loop. Now I see this is not true because the set will contain the object on the second invocation of doAdd - but this also means if the base class's add does indeed delegate the way I described then the object is not going to be added to the Vector at all. So all in all I still feel the patch relies on undocumented details of Vector's implementation and am not I sure when I'll find time to verify or falsify that feeling. It may be easier to avoid the arraycopy for the index==size() case without invoking any base methods anyway. I'll comment on the bug report directly so you don't have to relay between the bug reporter and this list. Stefan --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org