You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Petr Kuzel <Pe...@netbeans.com> on 2001/02/13 16:22:55 UTC

Tuning performance for small XML documents

Hello,

we spotted startup time regression in our application after we had
integrated Xerces 1.2.3 parser instead of Crimson one. The application
reads during startup tons of small (<2k) XML documents.

A profiling tool marked UTF8Reader constructor as expensive
"method" that takes many% of the application startup time.
Looking at it I tried a simple experiment with utils.UTF8DataChunk.
I have changed naively CHUNK_SHIFT to 11. But there is a hidden dependency
resulting in:

org.xml.sax.SAXException: Internal Error: fPreviousChunk == NULL
java.lang.RuntimeException: Internal Error: fPreviousChunk == NULL
        at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:969)

I have been looking for a documentation because sources are full of some 
literal constants and very hard readable, but failed. 

May be that this could be driven by a SAX property so applications handling
tons of small documents would set the property to a reasonable small
value decreasing array allocation penalty.

Does anybody know a workaround?

  Cc.

-- 
<address>
<a href="mailto:pkuzel@netbeans.com">Petr Kuzel</a>, Sun Microsystems
: <a href="http://www.sun.com/forte/ffj/ie/">Forte Tools</a>
: XML and <a href="http://jini.netbeans.org/">Jini</a> modules</address>