JDOM2 performance
Rolf Lear <[email protected]>
| Newsgroups | gmane.comp.java.jdom.general |
|---|---|
| Message-ID | <[email protected]> |
Hi all. As an exercise in a few things, I have run a number of comparative performance tests, comparing JDOM2 (Beta 2) against JDOM 1.1.3. I put together a performance 'test harness' to track the changes in the performance metrics for JDOM2, and I have taken that harness, stripped out those things which are not available in JDOM 1.1.3, and then run the system on both code bases. I ran the tests in Java5, Java6, and Java7. I took the performance harness cloned it for JDOM 1.1.3, and 'backported' it. I did the same types of changes to the JDOM2 harness to make them equivalent. I compiled both harnesses with Java6 using a Java5 class target. For the JDOM 1.1.3 test I linked in the JDOM 1.1.3 jar (which is compiled with Java5, and targets Java 1.2). For the JDOM2 test I linked in the Beta2 code (compiled with Java6 targetting Java 5). I then took those code bases, and ran them using the Java5, 6, and 7 JRE's. YOu can see the results here: http://hunterhacker.github.com/jdom/jdom2/performanceJDKBeta2.html From that page you can see a number of interesting things: firstly, the XPath expression '//.' is much, much, much faster than '//node()' (in jaxen). The second item is the jump in memory footprint from Java5 to Java6 You can see that most JDOM2 operations are slightly slower than JDOM 1.1.3, except XPath processing which is much, much faster. At face value it would seem the slower performance is all related to a slower JDOM class initialization.... I will look in to that. I figured the results were interesting, though, and there may be some benefit for others. Rolf _______________________________________________ To control your jdom-interest membership: http://www.jdom.org/mailman/options/jdom-interest/[email protected]