[jdom-interest] AttributeList performance

Elliotte Harold elharo at metalab.unc.edu
Thu Apr 28 10:29:21 PDT 2005


Victor Toni wrote:

> Therefore I suggested an additional class for qualified names. It would 
> help creating other access mechanisms. The current 
> Element.getAttribute(name) is O(N) but could be O(log(n)). Surely this 
> change would be mainly for cases where there are a lot of atrributes but 
> it would hurt simple documents?

While this might be asymptotically faster, I suspect in most use cases 
the current implementation is quite a bit faster. For small values of N, 
the constants matter.

-- 
Elliotte Rusty Harold  elharo at metalab.unc.edu
XML in a Nutshell 3rd Edition Just Published!
http://www.cafeconleche.org/books/xian3/
http://www.amazon.com/exec/obidos/ISBN=0596007647/cafeaulaitA/ref=nosim


More information about the jdom-interest mailing list