Hi,
I finally discovered that my SAX was validating whereas DOM was not. Now
that this is turned off, SAX is about 5% faster than DOM in my benchmark,
with an empty ContentHandler, without file I/O, with namespace support, and
without Schema validation.

Thanks for your answer, I will continue investigations to see if I can get
SAX parsing as faster than DOM building as you got -about 50%-.





-----Message d'origine-----
De : Erik Rydgren [mailto:[EMAIL PROTECTED]]
Envoy� : lundi 2 d�cembre 2002 19:47
� : [EMAIL PROTECTED]
Objet : RE: DOM faster than SAX ?


I did the same test as you. Parsed a XML file (size ~5k) with DTD validation
and reuse grammar 1000 times with DOM and 1000 times with SAX and an Empty
Document handler. I made sure to load up the grammar before doing the
benchmark so the grammar build time is not in the results.
And my result is that SAX is faster. SAX took aprox 6000ms and DOM took
approx 8700ms. And those results are not suprising at all :o)
So the conclusion... If SAX is slower then DOM for your application, then
take a peek at what you are doing in your content handler or just swap API.

Regards
Erik Rydgren
Mandarinen systems AB
Sweden

-----Original Message-----
From: Nikko [mailto:[EMAIL PROTECTED]]
Sent: den 2 december 2002 17:36
To: mailing list xercesc
Subject: DOM faster than SAX ?


Hi,
I've made some measurements, comparing a SAX parsing time to the time needed
to build a DOM tree, with the same pinput xml. All that without File I/O
time.

 Results are quite surprising : DOM seems to be 2* faster than SAX.
I was wondering if this could be due to the string conversion to local page,
that is made always in SAX, but only on demand on DOM ?

Any comment appreciated,

thanks


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

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.419 / Virus Database: 235 - Release Date: 13/11/2002

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.419 / Virus Database: 235 - Release Date: 13/11/2002


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

Reply via email to