Curtiss Howard wrote:


For a small file, SAX only had a 20% performance advantage over DOM. I'd expected much more. Surprisingly enough, as I increased the size
of the file being parsed, the performance advantage _narrowed_, not
widened, as I'd expected. Obviously the parse is going to be somewhat
slow due to schema validation, but I'm confused as to why SAX is
performing so poorly compared to DOM. Can anyone shed some light on
this?

Is it possible you're using the deferred DOM implementation? If so, Xerces DOM parser is not actually parsing part of the file until you actually walk the tree. That would explain why it seems to speed up with larger documents: more to skip. Personally I think this behavior is nonconformant to the XML and DOM specifications--it fails to detect well-formedness errors as early as required--but others disagree with me.


--
Elliotte Rusty Harold  [EMAIL PROTECTED]
XML in a Nutshell 3rd Edition Just Published!
http://www.cafeconleche.org/books/xian3/
http://www.amazon.com/exec/obidos/ISBN=0596007647/cafeaulaitA/ref=nosim

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to