Optimizing SAX CDATA handling

A

Aidan

The setup: a Sax parser in a servlet and a Java client (same machine) which
uploads an XML document containing CDATA elements which hold base 64
encoded binary files. The servlet then SAX parses the client's data. If I
comment out the parser call I can see that the transmition time of large
data files is very low.

My understanding is that a SAX parser should transmit the content of a CDATA
string downstream without signiificant processing.

What I see:

If the CDATA sections are small (1KB or so) the Sax parser processes the
document around 20ms.

When the CDATA sections are large (totalling 1MB for example) parsing
becomes drastically slower, edging up towards 1000ms.

The only diffence between the two documents is the size of the CDATA.

I've tried several Sax implementations but the behaviour is the same.

How can I speed up parsing ? Is there a way have the parser's lexical
analyser perform fast copy-through processing on large CDATA sections? Is
there a buffering issue here?

A
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,815
Latest member
treekmostly22

Latest Threads

Top