[jdom-interest] Performance tests

Dennis Sosnoski dms at sosnoski.com
Mon May 7 20:55:09 PDT 2001

Hi Graham,

Electric XML looks to have very fast parse initialization compared to Xerces SAX2
(which I used for my tests, and you used in the benchmark vs JDOM you've got on your
site). This is a known problem with Xerces (see
http://www.extreme.indiana.edu/~aslom/exxp/, for instance). I've been looking more at
large document performance, so it hasn't been much of an issue in my tests.

Some comments on the benchmark you give on your site:

Your test with a small SOAP document may not be a very realistic example for
comparing XML performance. Besides the size of the document itself, your test code
passes it to your parser as a String as opposed to the StringReader passed to the
parser for building JDOM. I realize that the Xerces parser does not accept a String
as input, but I'd suggest that this feature is of very little practical use. Making
use of it in a benchmark can give misleading results.

When I passed a StringReader to Electric XML it slowed down by about 40%, still much
faster than Xerces-JDOM on the very short document and reasonably faster even for
longer SOAP documents. I suspect your handling of namespaces (used heavily by SOAP)
is considerably more efficient than Xerces-JDOM's, something I hadn't covered in my
tests but should add.

With large documents (about 100K) which *don't* make much use of namespaces Electric
XML builds the documents at about the same speed as JDOM-Xerces - I added up the
times from three documents and came up with less than 7% difference in Electric XML's

  - Dennis

graham glass wrote:

> hi guys,
> 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.
> cheers,
> graham

More information about the jdom-interest mailing list