[jdom-interest] Performance percentages

Jason Hunter jhunter at collab.net
Fri Jun 1 16:06:56 PDT 2001


One thing I've been curious about is how much build time is accounted
for by the sax parser, how much by the verifier, and how much by
building the document structure.  

So what I did is timed the build process for several XML files of
varying sizes and types, trying first the code in CVS, then trying with
an empty Verifier (one that reports everything's always OK), then trying
with an empty SAXHandler (one where everything's ignored).  For files I
tried the three from Dennis' test plus two big "xlink" files, the first
of which has attributes in namespaces, the second of which does not.

Here's what I found.  The three timing values represent the time in ms
for the 2nd parse run, the 3rd run, and the average across the 4th
through 13th run.  I ignore the first run.  The test code is attached. 
Copy the included *.empty files on top of your CVS *.java files and
recompile JDOM to switch between tests.

LATEST IN CVS:
periodic: 80/60/120
much_ado: 100/100/176
xml: 240/270/242
xlink: 2253/2013/2993
xlink2: 1622/1613/2253

EMPTY VERIFIER:
periodic: 70/70/107
much_ado: 161/180/200
xml: 240/240/257
xlink: 2243/1722/2636
xlink2: 2603/2573/2722

So removing the verifier saves a bit (10% range) on the periodic table
and on xlink.  But removing the verifier actually increases (20%) the
time required to build much_ado and xlink2.  I'm not sure how to explain
that.  Maybe it has something to do with my earlier GC oddities?  Could
someone try the test on their machine?

EMPTY HANDLER:
periodic: 30/30/38
much_ado: 30/30/38
xml: 70/70/58
xlink: 821/822/835
xlink2: 730/721/744

These times represent the fixed costs about which we can do nothing. 
Seems we have 2/3 of the build time spent outside of raw parsing, so
optimization has the potential for a profound effect.

Comments welcome on the test model.  I'd appreciate it if someone using
hotspot, using JDK 1.3, and using JDK 1.1 could verify similar results.

-jh-
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jdom-perf1.zip
Type: application/x-zip-compressed
Size: 133343 bytes
Desc: not available
Url : http://jdom.org/pipermail/jdom-interest/attachments/20010601/27943268/jdom-perf1.bin


More information about the jdom-interest mailing list