cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@apache.org>
Subject Re: [Heads Up] Utility for efficiency
Date Fri, 18 Jan 2002 14:11:38 GMT
Piroumian, Konstantin wrote:

>>Berin Loritsch wrote:
>>
>>
> 
>  <snip/>
> 
>>Buffers are really great for FIFO (first in, first out).
>>
>>For LIFO (last in, first out), the JDK offers java.util.Stack, but its 
>>use should avoided since it is synchronized. There's an unsynchronized 
>>replacement in org.apache.avalon.excalibur.collections.ArrayStack.
>>
>>
> 
> Why not use java.util.LinkedList instead of java.util.Stack?


You obviously didn't look at the performance figures.

LinkedList is the most inneficient class, and you have to have a large number
of objects in that list to make it more efficient than ArrayList.  It is
still far less efficient than even Stack.  I will throw together a quick
test to prove that point--but we should never be dealing with lists long
enough to make LinkedList even remotely considerable.





-- 

"They that give up essential liberty to obtain a little temporary safety
  deserve neither liberty nor safety."
                 - Benjamin Franklin


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


Mime
View raw message