[jdom-interest] JDOM comparison with DOM

abisheks abhisheks at india.hp.com
Tue May 8 08:04:36 PDT 2001


Hello All,

I wrote a simple Java program that can build a DOM object or a JDOM Object
on a XML file of size 8 MB.

I found that the time taken to build a DOM object is lesser that the time
taken to build a JDOM Object.
But the memory utilized by JDOM is far less than DOM.

However, the documentation of JDOM suggested that the JDOM operates faster
than DOM ( at par with SAX ).

Why am I getting results that are different from what the JDOM documentation
sugguests ?

Both the source and the binary of my application is attached with this mail.

usage :

to build DOM:
java Compare <filename.xml> 1

to build JDOM
java Compare <filename.xml> 2

Here are the results which I got

C:\abhishek\app>java Compare test.xml 1
inside compare
Xml file to be parsed : test.xml
inside build Dom
Time taken to build Dom: 8212
Memory used to build Dom: 11190984

C:\abhishek\app>java Compare test.xml 2
inside compare
Xml file to be parsed : test.xml
inside build JDom
Time taken to build JDom: 15312
Memory used to build JDom: 6084888

regards,
Abhishek.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Compare.java
Type: application/octet-stream
Size: 2848 bytes
Desc: not available
Url : http://jdom.org/pipermail/jdom-interest/attachments/20010508/3cd68625/Compare.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Compare.class
Type: application/octet-stream
Size: 2569 bytes
Desc: not available
Url : http://jdom.org/pipermail/jdom-interest/attachments/20010508/3cd68625/Compare-0001.obj


More information about the jdom-interest mailing list