[jdom-interest] Presences of Namespace dramatically slows SAXBuilder

Ken Klose Ken.Klose at imedium.com
Tue Apr 3 11:35:25 PDT 2001


I apologize if this has already been discussed.  I have been using JDOM to
read and manipulate rather large documents (via SAXBuilder).  The documents
are changing - moving the elements into a namespace - and performance has
become horrible. I've whipped together an example that constructs a document
similar to the one in question (both with namespaces and without) and reads
it in using SAXBuilder and DOMBuilder.  A summary of the results:

No namespace DOMBuilder read: 551ms
Namespace DOMBuilder read: 2383ms
No namespace SAXBuilder read: 371ms
Namespace SAXBuilder read: 24,075ms

Questions:
1. Do namespaces really add so much complexity that they alone should
account for a four-hold increase in the parse time of DOMBuilder?
2. Is the problem resulting in the 64 fold increase in SAXBuilder parse time
in SAX or JDOM?

Again I apologize if this is old news.

I've attached the Java source file I used to produce the above results.

Ken
 <<NamespacePerformance.java>> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: NamespacePerformance.java
Type: application/octet-stream
Size: 4726 bytes
Desc: not available
Url : http://jdom.org/pipermail/jdom-interest/attachments/20010403/eab3183a/NamespacePerformance.obj


More information about the jdom-interest mailing list