[jboss-dev-forums] [JBoss XML Binding Development] - first stax performance test

Alexey Loubyansky do-not-reply at jboss.com
Fri May 7 06:52:23 EDT 2010


Alexey Loubyansky [http://community.jboss.org/people/alex.loubyansky%40jboss.com] created the discussion

"first stax performance test"

To view the discussion, visit: http://community.jboss.org/message/541766#541766

--------------------------------------------------------------
I've written a simple StAX-based parser for XB to see how it affects the performance. I've used the same tests I've been using previously while working on optimizations and comparison to JAXB.

I'd like to mention that XB testsuite with StAX parser has a few failures related to required attributes with default values and tests related to XInclude. In JBoss AS both of these are important.
As to the default attributes, if they are missing from the xml, the parser is supposed to silently add them in. But this happens (with SAX at least) only if the validation is enabled. The StAX impl I've used for testing (which is included in JDK6) doesn't seem to support validation (setting isValidating proprty to true fails).
XInclude is not supported. But if necessary, I guess, we implement it on top.

The results show the average time (in ms) of 10 independent re-runs and include the time for the first test run (includes parser initialization, classloading, etc) and subsequent 1000 runs.

XB with SAX (custom written handlers, XInclude disabled, property replacement disabled, non-validating)
first run: 127.1
next 1000 runs: 892.4

XB with SAX (default handlers, XInclude disabled, property  replacement disabled, non-validating)
first run: 127.8
next  1000 runs: 997

JAXB (XInclude disabled, non-validating)
first run: 119.8
next 1000 runs: 1088.4

XB with StAX (custom written handlers, property replacement  disabled)
first run: 22.6
next 1000 runs: 1015.3

XB with StAX (default reflection-based handlers, property replacement disabled)
first run: 24.8
next 1000 runs: 1102.1

The initialization with StAX is unbeatable. But then actually parsing and unmarshalling isn't showing that well. Just to be clear, what I did is just switched from SAX events to StAX, the parser looks very simple (create stream and pull events), I don't see potentially significant optimizations there.

--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/541766#541766]

Start a new discussion in JBoss XML Binding Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2065]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20100507/e439d9fa/attachment.html 


More information about the jboss-dev-forums mailing list