On Fri, 15 Jun 2012 12:35:07 -0300, Lance Java <lance.j...@googlemail.com> wrote:

Have you checked 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-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to