ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jose Alberto Fernandez" <jalbe...@cellectivity.com>
Subject RE: Massively OT, 'Closures in Java' [was Re: AW: [Patch] modifiedselector, style, remove unused code, slightly more lazy DigestAlgorithm.getValue (now with added source code -doh!)]
Date Mon, 28 Feb 2005 11:08:56 GMT
AFAIU, LinkedList.get(N) requires traversing the list to position N
on every call [O(n^2)], so usage of an iteratoe is much cheaper on this
case
as there is no array behind the scenes. 

Jose Alberto

> -----Original Message-----
> From: Kev Jackson [mailto:kevin.jackson@it.fts-vn.com] 
> Sent: 28 February 2005 11:03
> To: Ant Developers List
> Subject: Massively OT, 'Closures in Java' [was Re: AW: 
> [Patch] modifiedselector, style, remove unused code, slightly 
> more lazy DigestAlgorithm.getValue (now with added source code -doh!)]
> 
> 
> Jose Alberto Fernandez wrote:
> 
> >Just one comment on your ClosureUtils.map() method.
> >
> >Although this code may be very good for ArrayList, I think
> >it will behave quite bad for LinkList arguments where
> >the cost of List.get(i) is quite expensive.
> >
> >  
> >
> When I read this, I thought "Doh! you're right none-sequential List 
> access is expensive", but I just rewrote the tests using a LinkedList 
> and the time is identical.  Maybe it's because the 
> ClosureUtils requires 
> a List interface not an ArrayList object, and as such it treats 
> everything as simply something that implements List and uses 
> the lowest 
> common denominator, or maybe it's because my test data is trivial 
> [shrug].  Still interesting code-doodle anyway.  Thanks for 
> the feedback ;)
> 
> Kev
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message