aspose file tools*
The moose likes XML and Related Technologies and the fly likes DOM4j , JDOM, DOM and Sax Performance Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "DOM4j , JDOM, DOM and Sax Performance" Watch "DOM4j , JDOM, DOM and Sax Performance" New topic
Author

DOM4j , JDOM, DOM and Sax Performance

ravisha andar
Ranch Hand

Joined: Feb 25, 2011
Posts: 55
Hi All,

I have read about all the 4 technologies , but still have confusions over which one gives a better performance.

Can anybody help me in understanding which of these is preferred for performance.

Thanks
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12835
    
    5
Since all parsers that I am familiar with actually use a SAX parser as a starting point, about the only thing we can say is that SAX is always fastest since the others build on top of SAX.

That is such a superficial answer that it really feels sort of silly to write it down.

In reality, a skilled programmer would select an approach by considering the entire problem since parsing is only part of using XML.

There have been oh-so-many discussions of this type in this forum, browse around in the old threads.

Bill
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18987
    
    8

A skilled programmer would also not evaluate products based on a vague term like "performance". Instead he or she would consider memory usage, speed of processing, and probably other "performance" factors.
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
These are Application Programming Interfaces (API), they are not "parsers." They help developers develop applications that interact with a parser. To understand them clearly is to recognize that the "parsing" and the "processing" that you code is not the same. That said, the performance or speed of any application written with any of these API will depend mostly on how well the application was written. If it is written in a poor way with memory hogging data structures and such, it might be much slower than a different application written with the same API but with a more efficient design.

Aside, if you can write an application using the Simple API for XML (SAX), this will most likely be the fastest. But, depending upon the actual requirements it may take longer to write or may exceed the programmer's skill level, i.e. writing SAX-based code takes advanced knowledge of XML and Java.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: DOM4j , JDOM, DOM and Sax Performance