Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JDOM User »

[jdom-interest] Updated StAXBuilder

Tatu Saloranta

2004-11-15


I updated StAX builder classes a bit, to improve
performance: find attached the builder, and a matching
optimized factory class. Latter should also be usable
with SAX parsers to improve their performance a bit
(not tested, but I don't see why it wouldn't work).
There are some other things that could be done to JDom
builders to improve things further, but they'd need
more access (there are "safe" modifiers that builders
that pass known valid content could use).

So, why use StAX parsers instead of SAX? There are no
ground-breaking benefits, but some reasons might be:

* StAX parsers are often more light-weight than SAX
ones; if you already use StAX parser for performance
critical parsing, you could just use it without
adding Xerces
* Fastest StAX parsers (Woodstox, Sun's new StAX
parser
["Zephys"]) are slightly faster than fastest SAX
parser (Xerces)... effect is not huge with JDom,
though, since major overhead is building the tree,
not parsing.

In any case, here are the classes in case anyone finds
then useful. They are also available from StaxMisc
page at:

http://www.cowtowncoder.com/proj/staxmisc/index.html

-+ Tatu +-



   
__________________________________
Do you Yahoo!?
Meet the all-new My Yahoo! - Try it today!
http://my.yahoo.com


Attachment: StAXBuilder.java

Attachment: FastJDOMFactory.java
_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/youraddr@(protected)
©2008 junlu.com - Jax Systems, LLC, U.S.A.