[jdom-interest] Performance tests
graham-glass at mindspring.com
Mon May 7 01:59:25 PDT 2001
the july edition of XML-Journal will include a technical
comparison of electric XML and jdom, and includes a set of
benchmarks for common operations including parsing, gets/sets,
and xpath operations. i used four different sets of XML sample
files, ranging from 10 lines to 10,000 lines. small XML files
are typical for SOAP RPC messaging, whereas 10,000+ line files are
common for business information exchange.
From: jdom-interest-admin at jdom.org
[mailto:jdom-interest-admin at jdom.org]On Behalf Of Dennis Sosnoski
Sent: Monday, May 07, 2001 3:22 AM
To: jdom-interest at jdom.org
Subject: [jdom-interest] Performance tests
Just a note that I've got a performance test program running. I'll add the
information and full distribution to my site Monday night, but in the
here's a summary of the results for working with a sampling of medium-sized
(100-200K) XML files:
Document building speed -
Best results are from Xerces DOM with deferred node expansion (Xerces
This is more than made up for if you actually use most of the document (as
opposed to reading it in and looking at only a small portion), though.
Next best Crimson DOM, dom4j, and Xerces DOM with deferred node expansion
off (Xerces base) are all close on speed, JDOM and Electric XML the slowest
the representations tested. The difference is roughly 50% added time from
Crimson DOM to JDOM.
Document memory requirement -
Best results again for Xerces deferred, but going through the document
the nodes to largest size of all.
Next best is Crimson DOM, then Xerces base, followed by Electric XML, JDOM
dom4j. The difference is about 25-40% added space in going from Crimson DOM
Walking the document nodes -
Best by far is Xerces base, followed by Electric XML and Crimson DOM, then
dom4j. JDOM is nearly as bad as Xerces deferred at this (with Xerces
all the nodes as it goes). Xerces base is 10-20 times the performance of
JDOM/Xerces deferred in this test.
Output to text -
Crimson DOM, Xerces base and deferred, Electric XML all fairly close on
JDOM took about 50% more time, but dom4j about 100-150% more time than
Those that implemented this (Xerces, JDOM, and Electric XML - dom4j appeared
broken and Crimson didn't support it) all did pretty badly. With the
implementations you're much better off just outputting text and parsing it
in, this will be about twice as fast and the data will be half the size.
I used three different XML files representing different types of XML (heavy
attributes vs no attributes, shallow tree vs deeper tree). The results
depending on the type of XML, and I'll try to qualify this when I put
up on the site. The code will also be available for review and
It's really rough trying to get consistent results for timing with a Hot
JVM, and some of the timing runs are dramatically better than others, but
above figures should be loosely representative for the most recent released
versions of the products (Beta 6, in JDOM's case).
To control your jdom-interest membership:
More information about the jdom-interest