[jdom-interest] Re: New realease, Text class... Arghh

Bradley S. Huffman hip at a.cs.okstate.edu
Wed Jan 9 14:31:06 PST 2002

> >>>I'm not sure I get your third point about Filter iterators<<<
> Look at the FilterListIterator implementation and all the suff it has to
> do... In most case, we want to browse the list without dealing with data
> change. In fact, we does'nt need a ListIterator, simply an Iterator.
> From a performance point of view, this method will just allocate an Iterator 
> object and that's all. The iteration is straighforward.

You don't even need a Iterator.  Adding methods attributeCount(), nodeCount(),
getAttribute( int), and getContent( int) provides the best performance by
giving direct access to the backing list without without sacrificing

> For a global point of view, I'm very concerned with performance. Because of i
> ts architecture and its simplicity, I'm sure that JDOM can beat all others
> DOM. But this is not currently the case be cause of some design choices.

Yep, and equally important are correctness and ease of use.  IMHO, FilterList
and Filter are great ideas and in the furture will prove to be one of JDOM
best features. The concept is safe, the implementation might need a little
tweeking, but concept is good.

Same with Text, the concept is good, encapsulate the checks and verification
for XML text in it's own class.  Was it a disruptive change, yes, but better
now then after a final release.

Deadline for a final release?  IMHO, beta8 will get us pretty close.

> Currently, the DOM comparison chart on IBM Web site does not encourage
> people to choose JDOM.

Don't believe everything you read, those test have a problem because he used
a Iterator (there's that nasty beast again) to walk a Element's content
instead of a for loop with a int, i.e. 5000 elements => 5000 Iterator creations.
Changing BenchJDOM to use a for loop gave a performance increase of 10-30%.
Changing Element and using the 4 methods above cut the time by 2/3.


More information about the jdom-interest mailing list