OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: XML Parser in Servlet Performance Problem



Ed,

This is a good suggestion, but in fact it has no detectable effect (in any of
the cases of XP, Aelfred, or JaxP running under Tomcat on Win2000).

Jeff

PS:  I have yet not had the chance to test other XML parsers that have been
suggested.


Ed Scherer wrote:

> Did you try wrapping the ServletInputStream with a
> java.io.BufferedInputStream and then specifying the
> java.io.BufferedInputStream in your org.xml.sax.InputSource?
>
> > -----Original Message-----
> > From: Jeff Lansing [mailto:jeff@polexis.com]
> > Sent: Tuesday, February 6, 2001 1:12 PM
> > To: XML-DEV
> > Subject: XML Parser in Servlet Performance Problem
> >
> >
> > Hi,
> >
> > I'm experiencing a serious performance problem when parsing XML from a
> > ServletInputStream in my doPost() handling.
> >
> > My input data is in the form of a very shallow xml document which looks
> > like:
> > <TermList>
> >   <Identifier>list33</Identifier>
> >   <Term>dogfood</Term>
> >   <!-- 1000's of these -->
> >   <Term>kitty litter</Term>
> > </TermList>
> >
> > A simple SAX parse of this data takes anywhere from 15 to 100 times
> > longer if it is done in a servlet, rather than in a Java application
> > which is reading the data from a file. I have tried reading the data
> > into a string, and using a StringBufferInputStream instead, with no
> > change. I have tried having the servlet read the data into a file first,
> > and then using a FileInputStream, with no change. The problem is not in
> > reading the input, but in doing the parsing. (There is also a small hit
> > for instantiating the parser.)
> >
> > I have tried the following combinations:
> > ServletEngine: iPlanet, Tomcat, JRun
> > Parser: Xerces, JaxP, xp, Aelfred
> > OS: Solaris, Win2000
> > the best combination is Tomcat + JaxP, the worst is Xerces + JRun.
> >
> > I have tried capturing the system time at each call to startElement() in
> > a SAX DocumentHandler, and I see that the behavior is nearly linear (or
> > linearly bad), with longer documents taking very slightly longer per
> > call.
> >
> > This is killing me. Help.
> >
> > Jeff
> >
> >