You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Antoine Levy-Lambert <an...@gmx.de> on 2010/12/13 01:44:24 UTC

Bug 50200, VectorSet kills the performance of DirectoryScanner

Hi,

I got a private email asking me to apply the patch suggested by 
*Bug 50200* <https://issues.apache.org/bugzilla/show_bug.cgi?id=50200> - [1]
      VectorSet kills the performance of DirectoryScanner

The code looks good and I am wondering why we have the current implementation.

Stefan ?

Antoine

[1] https://issues.apache.org/bugzilla/show_bug.cgi?id=50200


Re: Bug 50200, VectorSet kills the performance of DirectoryScanner

Posted by Stefan Bodewig <bo...@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* <https://issues.apache.org/bugzilla/show_bug.cgi?id=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