[jdom-interest] AttributeList performance

Elias Ross eross at m-qube.com
Mon Apr 25 12:20:50 PDT 2005


On Sun, 2005-04-24 at 11:56 -0400, Martin Schulz wrote:
> we have been running into a performance problem caused by the O(N) 
> performance characteristic
> of the JDOM AttributeList in the indexOf method.  This affects both 
> insertions and lookup of Attributes.

Can performance be mitigated by sorting the attributes by name, and do a
binary search for the Attribute instance?

To handle the common case (where merely 2-3 attributes exist) and
modification (where attributes are added/removed), I would have then an
unsorted list.




More information about the jdom-interest mailing list