Java - XML parser performance : Sun Java Streaming XML Parser (SJSXP) vs Woodstox

5.2k views Asked by At

I am looking for latest, memory efficient and high-performance java XML parsing API. I need to parse 3 MB to 5 MB XML files.

I did google on this and come to know about Sun Java Streaming XML Parser (SJSXP) and Woodstox is much faster than DOM & SAX. Both are using StAX API. *schema validation is not supported by these technologies.

Aalto XML processor is also implements StAX API.

I have not found concrete findings on performance on these technologies.

Which one will be best in context of memory efficient, high-performance and ease of use ?

2

There are 2 answers

4
StaxMan On BEST ANSWER

Here are some more links that might be relevant:

As to performance: SJSXP is the slowest; it's just a repackage internals of Xerces, wrapped in Stax API. This has some negative effects on performance (since it's not really designed for pull parsing). Woodstox is bit faster; much faster for small documents and writing, less difference when parsing longer documents.

And Aalto is by far fastest of the three, especially for parsing. It is commonly 50% - 100% faster than either Woodstox or SJSXP. One downside is that it does not handle DTDs (and thereby not external entities; it handles pre-defined and character entities).

Disclaimer: I am author of Woodstox and Aalto; as well as contributor to SJSXP (bug fixes)

2
Santosh On