Could you please give some details on the measurements that you took, document size, observation about type of documents, etc.
What about validation vs. no validation, namespace vs. no-namespace, Schema validation on? etc. Just want to make sure that I understand your comparison.
You observation is quite interesting.
What do you mean by string conversion to local page?
SAX/SAX2 should return to you Unicode ( XMLCh buffers)so you mean
string conversion from local page to Unicode, right?
You said that conversions are deferred in DOM API, until the time when you want to access nodes. Is this true? so we buffer the localized strings in memory until the time in which we do DOM traversing and need to materialized Strings? That could explain the timing difference.
So the following experiment should be able to give some light.
Given a Unicode document which doesn't have to be transformed then
If you parse such a document using SAX vs DOM then SAX should be faster.
If such experiment returns DOM as being faster by 2x then in my opinion there is a bug in the SAX implementation ( I could have swear that DOM uses SAX internally... or a sax like implementation).
Would like to hear any comments from the XML parser developers.
Thanks,
Jeffrey Rodriguez
From: "Nikko" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: "mailing list xercesc" <[EMAIL PROTECTED]>
Subject: DOM faster than SAX ?
Date: Mon, 2 Dec 2002 17:35:31 +0100
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
---
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
_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
