« Return to Thread: Performance of Woodstox StAX vs Java SAX

Re: Performance of Woodstox StAX vs Java SAX

by Tatu Saloranta :: Rate this Message:

Reply to Author | View in Thread

Some parts of this message have been removed. Learn more about Nabble's security policy.
For what it's worth, now that Woodstox also implements SAX interface (as of 3.2.0), it is possible to see what effects API might have on implementations. With Woodstox, access via SAX API is slightly slower (for trivial browse-through case), but difference is minor (5-10%). Conceptually SAX and StAX interfaces are both low-level, and although to implement StAX one has to retain more state (and therefore gets more complicated), there are also couple of more optimizations one can do, as more processing can be deferred on as-needed basis than with SAX. But these do not have major effect on most usage.

Personally I would like to think that the speed is because Woodstox was designed from beginning with specific API and functionality in mind (as opposed to having to add new things like namespaces after the fact), as well as due to performance having been one of the top priorities throughout development.

As to Java-vs-C, interestingly there is one fairly recent comparison:

http://www.xml.com/pub/a/2007/05/09/xml-parser-benchmarks-part-1.html

results of which seem in line with what I would expect. Fastest (?) C implementation is bit faster than Woodstox, roughly with same ratio as Woodstox is faster than Xerces/SAX. Woodstox was the fastest of Java alternatives.

I hope this helps,

-+ Tatu +-

ps. Just in case it's not obvious, ObDisclaimer is that as the author of Woodstox my opinions may be slightly biased. ;-)

----- Original Message ----
From: Michael Kay <mike@...>
To: user@...
Sent: Thursday, August 16, 2007 2:15:58 AM
Subject: RE: [woodstox-user] Performance of Woodstox StAX vs Java SAX

Two reasons. Firstly, Woodstox is fast, no question about it. Secondly, I think the API is slightly lower-level. In my experience a pull parser is doing a little bit less work and unless you are very careful, the application has to do a little more. It's very easy to lose all the performance gains by the time you've written your application code.
 
Michael Kay


From: harbhanu [mailto:harbhanu@...]
Sent: 16 August 2007 09:50
To: user@...
Subject: [woodstox-user] Performance of Woodstox StAX vs Java SAX

 

Hi,

I am a newbie to this group…. Before I start actively using this parser, I have a query regarding its performance..

 

As per the parsing benchmarks reported at ….

http://www.xml.com/pub/a/2007/05/09/xml-parser-benchmarks-part-1.html?page=1

The performance of Woodstox StAX is always better than even the Java SAX Implementation.

Any particular reason for the results to be like this?

 

Did anyone of you do similar kind of performance benchmarking of C/Java based parser w.r.t to Woodstox.

Thanks!!

 

Regards,

Harbhanu




Choose the right car based on your needs. Check out Yahoo! Autos new Car Finder tool.

 « Return to Thread: Performance of Woodstox StAX vs Java SAX