commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian McCallister <mccallis...@forthillcompany.com>
Subject Re: [collections] [PATCH] CompositeCollection class for Commons-Collections
Date Mon, 03 Nov 2003 01:44:03 GMT

On Sunday, November 2, 2003, at 07:27 PM, Stephen Colebourne wrote:
> I haven't tested it, but I suspect the performance gain to be 
> noticable, and
> [collections] has to choose the fastest implementation if it has a 
> choice.
> Would you consider the alternative implementation I suggest?
>
> Stephen

Performance optimized version attached. I think this actually reads 
more clearly anyway. Must try to stop thinking in Ruby when writing 
Java =) I also cleaned up the spec breaking toArray(Object[] array) 
implementation.

The highly unoptimized part is adding and removing composited 
collections. I let ArrayList handle the array resizing for me.

-Brian



Mime
View raw message