You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by Christopher Lenz <cm...@gmx.de> on 2002/05/24 13:49:59 UTC

XML parsing performance (Re: cvs commit: jakarta-slide/src/webdav/server/org/apache/slide/webdav/method SearchMethod.java)

Am 23.05.2002 07:23:08, schrieb juergen@apache.org:
>juergen     02/05/22 22:23:08
>
>  Modified:    src/webdav/server/org/apache/slide/webdav/method
>                        SearchMethod.java
>  Log:
>  Replaced usage of org.w3c.dom by JDOM.
>  (ralf)
>  
[...]

I've been noticing the recent trend to replace W3C DOM usage by 
JDOM to parse the DAV request bodies. I think this should be 
discussed a bit (although of course those who actually *do* 
stuff can also do the decision ;P).

JDOM isn't actually famous for it's performance. It's advantage
now and in the past has been the ease of use.

The problem is that a WebDAV server should be as efficient as 
possible when it comes to XML processing. Our XML generation is
already as low-level as it can probably get. Our input processing
used to be based on DOM, and is now moving to JDOM, both of which 
are memory-intensive and on the slow side.

There's a very interesting article on IBM's developerWorks about the
performance of various XML parsing concepts and implementations:
http://www-106.ibm.com/developerworks/xml/library/x-injava/index.html

Neither JDOM nor Xerces/Crimson-DOM get very good results. Options 
for better performance seem to be:
- Use dom4j:
  Faster than DOM/JDOM, and offers direct XPath support for document
  navigation, which I think could be quite useful for hanlding WebDAV 
  requests.
- Use SAX2:
  Naturally quite fast, but to use SAX2 somewhat conveniently, there 
  would need to be helper classes for the various DAV XML elements. 
  It's not quite clear how much overhead such a layer would introduce.
- Use XPP:
  From the article: "XPP is the performance leader in most respects. 
  For middleware-type applications that do not require validation, 
  entities, processing instructions, or comments, XPP looks to be an 
  excellent choice despite its newness."
  That description fits pretty well to our requirements. The package 
  is small, and has an Apache-style license.

I think it would be very interesting to benchmark JDOM, DOM4J and 
JDOM used in the WebDAV servlet. Don't currently have the time to do 
this though, just thought I'd share some thoughts on this topic.

On the other hand, current WebDAV clients (most prominently MS 
WebFolders) don't issue all too complex requests (the typical 
PROPFIND doesn't even have a body, nor a Depth:-header -- ugh). So
maybe efficient request body parsing isn't *that* important.

Thoughts?
-chris
_______________________________________________
 /=/ cmlenz at gmx.de





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: XML parsing performance (Re: cvs commit: jakarta-slide/src/webdav/server/org/apache/slide/webdav/method SearchMethod.java)

Posted by Kevin O'Neill <ke...@rocketred.com.au>.
> - Use dom4j:
>   Faster than DOM/JDOM, and offers direct XPath support for document
>   navigation, which I think could be quite useful for hanlding WebDAV 
>   requests.

I've switch from jdom to dom4j for the majority of my projects and found
the performance slightly better. The big winner has been the usage of
xpath to access nodes in the trees.

k.  


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>