<html><div style='background-color:'><DIV>
<DIV>
<DIV>I have been researching parsing performance and wanted to compare DOMBuilder and SAXBuilder in JDOM. I cam across the XPB4J project (<A href="http://www.pankaj-k.net/xpb4j">http://www.pankaj-k.net/xpb4j</A>) which has a test suite useful for comparing various parsers.</DIV>
<DIV> </DIV>
<DIV>After peeking at the JDOM driver, I updated it to use an iterator for accessing the child List and also swapped in DOMBuilder. The results were unexpected, the DOMBuilder out-performed the SAXBuilder in both speed and memory.</DIV>
<DIV> </DIV>
<DIV>Any ideas what may be going on here? I am using jdom beta 8 with 1.4.1_02 jdk.</DIV>
<DIV> </DIV>
<DIV>Here are the full results:</DIV>
<DIV>run-sax:<BR> [echo] xpb.datadir = xmldata<BR> [xpbtask] Input Files: xmldata\res0.xml[12 KB]<BR> [xpbtask] ------------- xstat, sax, ops per run: 100 -------------<BR> [xpbtask] RUN :: AvgT/op (ms) MemU/run (KB)<BR> [xpbtask] 0 :: 14 638<BR> [xpbtask] 1 :: 8 193<BR> [xpbtask] 2 :: 8 193<BR> [xpbtask] 3 :: 8 193<BR> [xpbtask] ------------------------------------------------------</DIV>
<DIV>run-dom:<BR> [xpbtask] Input Files: xmldata\res0.xml[12 KB]<BR> [xpbtask] ------------- xstat, dom, ops per run: 100 -------------<BR> [xpbtask] RUN :: AvgT/op (ms) MemU/run (KB)<BR> [xpbtask] 0 :: 21 365<BR> [xpbtask] 1 :: 11 1459<BR> [xpbtask] 2 :: 11 1528<BR> [xpbtask] 3 :: 14 1528<BR> [xpbtask] ------------------------------------------------------</DIV>
<DIV>run-xpp:<BR> [xpbtask] Input Files: xmldata\res0.xml[12 KB]<BR> [xpbtask] ------------- xstat, xpp, ops per run: 100 -------------<BR> [xpbtask] RUN :: AvgT/op (ms) MemU/run (KB)<BR> [xpbtask] 0 :: 13 259<BR> [xpbtask] 1 :: 8 168<BR> [xpbtask] 2 :: 8 168<BR> [xpbtask] 3 :: 8 168<BR> [xpbtask] ------------------------------------------------------</DIV>
<DIV>run-jdomdom:<BR> [xpbtask] Input Files: xmldata\res0.xml[12 KB]<BR> [xpbtask] ------------- xstat, jdomdom, ops per run: 100 -------------<BR> [xpbtask] RUN :: AvgT/op (ms) MemU/run (KB)<BR> [xpbtask] 0 :: 35 1299<BR> [xpbtask] 1 :: 15 774<BR> [xpbtask] 2 :: 18 673<BR> [xpbtask] 3 :: 17 673<BR> [xpbtask] ------------------------------------------------------</DIV>
<DIV>run-jdomsax:<BR> [xpbtask] Input Files: xmldata\res0.xml[12 KB]<BR> [xpbtask] ------------- xstat, jdomsax, ops per run: 100 -------------<BR> [xpbtask] RUN :: AvgT/op (ms) MemU/run (KB)<BR> [xpbtask] 0 :: 90 2295<BR> [xpbtask] 1 :: 90 2038<BR> [xpbtask] 2 :: 79 2062<BR> [xpbtask] 3 :: 81 1950<BR> [xpbtask] ------------------------------------------------------</DIV>
<DIV>run-xslt:<BR> [xpbtask] Input Files: xmldata\res0.xml[12 KB]<BR> [xpbtask] ------------- xstat, xslt, ops per run: 100 -------------<BR> [xpbtask] RUN :: AvgT/op (ms) MemU/run (KB)<BR> [xpbtask] 0 :: 126 892<BR> [xpbtask] 1 :: 70 660<BR> [xpbtask] 2 :: 61 660<BR> [xpbtask] 3 :: 63 652<BR> [xpbtask] ------------------------------------------------------</DIV>
<DIV>run-dom4j:<BR> [xpbtask] Input Files: xmldata\res0.xml[12 KB]<BR> [xpbtask] ------------- xstat, dom4j, ops per run: 100 -------------<BR> [xpbtask] RUN :: AvgT/op (ms) MemU/run (KB)<BR> [xpbtask] 0 :: 27 1262<BR> [xpbtask] 1 :: 14 955<BR> [xpbtask] 2 :: 18 955<BR> [xpbtask] 3 :: 30 955<BR> [xpbtask] ------------------------------------------------------<BR></DIV></DIV></DIV></div><br clear=all><hr>Tired of spam? Get <a href="http://g.msn.com/8HMCENUS/2734">advanced junk mail protection</a> with MSN 8.</html>