Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DOM4j , JDOM, DOM and Sax Performance

 
ravisha andar
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 21137
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic