[jdom-interest] JDOM comparison with DOM

Jason Hunter jhunter at acm.org
Tue May 8 10:00:23 PDT 2001


Some issues with the test:

* You didn't "prime the pump" with an initial run in either case, so
time to load classes will dominate the timings

* Your memory comparison assumes System.gc() does a full gc but in
general it doesn't

* You don't say if you're using beta6 or the version from CVS that has
the performance enhancement

-jh-

> 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.
> 
>   ------------------------------------------------------------------------
>                    Name: Compare.java
>    Compare.java    Type: unspecified type (application/octet-stream)
>                Encoding: quoted-printable
> 
>                     Name: Compare.class
>    Compare.class    Type: unspecified type (application/octet-stream)
>                 Encoding: base64



More information about the jdom-interest mailing list