Importantly, the critical thing done with an Element, rendering markup to a
character stream, walks the list and doesn't use this method.

Earlier versions of Tapestry uses an internal ArrayList for storing the
children; this was changed in 5.1 or 5.2 to help reduce the memory
footprint of pages.

On Fri, Jun 15, 2012 at 8:46 AM, Thiago H de Paula Figueiredo <
thiag...@gmail.com> wrote:

> On Fri, 15 Jun 2012 12:35:07 -0300, Lance Java <lance.j...@googlemail.com>
> wrote:
>
>  Have you checked 
> http://tapestryxpath.**sourceforge.net<http://tapestryxpath.sourceforge.net>
>>>
>> I'm aware of the library but I haven't used it. I can only assume that it
>> makes use of Element.getChildren() too (unless it accesses the private
>> "firstChild" and "nextSibling" fields which I highly doubt).
>>
>
> I guess you're right.
>
>
>  Have you done any benchmarks to know how much resources (CPU time,
>>> memory) it actually uses
>>>
>> No, but I think we can both see that getChildren() will require 2N
>> iterations to iterate the list of children. I think we can also see that
>> isEmpty() will cause N iterations where 1 would do.
>>
>
> Unless N is very high, it won't make a difference. Still O(n).
>
>
>  If I spent my time benchmarking things like this instead of just fixing
>> them, I'd never get anything done ;)
>>
>
> Yep, but you risk optimizing something that will make a very low
> difference in the end. And this specific code is not broken. ;)
>
>
> --
> Thiago H. de Paula Figueiredo
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: 
> users-unsubscribe@tapestry.**apache.org<users-unsubscr...@tapestry.apache.org>
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

Reply via email to