[jdom-interest] Performance tests

graham glass graham-glass at mindspring.com
Mon May 7 21:33:59 PDT 2001

hi dennis,

thanks for your email!

i'm going to replace the current benchmarks on my site
with the ones that are going to be published soon, as they
cover a broader set of use cases which i think are more realistic.

the benchmark on my site runs each parser at maximum
performance, which i think is fair. electric xml is
optimized for when you pass in a string, and JDOM is not.

there is no doubt that when the document size increases,
the difference between the various parsers tends to
converge, which is reflected by the benchmarks that i
present in the upcoming article.

some folks need very fast parsing for small documents,
and others need fast parsing for large documents. in some
cases, memory footprint is important which is another
area that electric xml does well.

thankfully, there is a good selection of parsers to pick
from these days.


-----Original Message-----
From: Dennis Sosnoski [mailto:dms at sosnoski.com]
Sent: Monday, May 07, 2001 10:55 PM
To: graham glass
Cc: jdom-interest at jdom.org
Subject: Re: [jdom-interest] Performance tests

Hi Graham,

Electric XML looks to have very fast parse initialization compared to Xerces
(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
as input, but I'd suggest that this feature is of very little practical use.
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
XML builds the documents at about the same speed as JDOM-Xerces - I added up
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