[jdom-interest] (no subject)

phil at triloggroup.com phil at triloggroup.com
Fri Aug 24 06:29:26 PDT 2001


I downloaded and used the Beta 7 and enjoyed the new capabilities.
>>>Thanks for all the work!<<<

I'm still focused on performance and found bottlenecks:

=> Element.getContent() as well as Element.getAttributes() still return a partial list. This is really a performance pb,
when using for example with Jaxen. In my own copy of JDOM, I removed this List copy and it works very well and really
I know that somebody is working on a new list implementation. But it does'nt prevent from making the current
implementation efficient :-)
By the way, is there any specs about these new lists. I worry about that because it is really a hotspot.

=> SAXHanlder
The std SAX specs says that a SAX engine may send a string as several parts. That's the reason why you do an addContent
() in the SAXBuilder. Unfortunatly, this leads to both memory and performance pb since addContent() do a concatenation
of the previous string with the new one. When dealing with XML file with big content, this is really a pb.
I attached my own version of SAXHandler that solves it, using a temporary StringBuffer.

By the way, I also have other remarks
=> The new Document(null) now generates a compiler error because of an ambuiguity. Why not publishing the empty ctor
(new Document())?
=> I really need a way for disabling all the checks when I load from a trusted file. This takes really too much time!
For now, I created my own classes, inheriting from the existing, and I disabled all the checks. But, I suggest to make
the checks optionnal, simply by passing a parameter to the constructor. Then a builder like SAXBuilder is able to pass
either true or false to these constructor, simply by using a property value.
=> The factory declares 4 element() method while the SAXBuilder only use 2 of them. If we don't need all of them, it is
better to remove them. This is easier to implement.

(See attached file: SAXHandler.java)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SAXHandler.java
Type: application/octet-stream
Size: 25929 bytes
Desc: not available
Url : http://jdom.org/pipermail/jdom-interest/attachments/20010824/f4263af3/SAXHandler.obj

More information about the jdom-interest mailing list