You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Christophe Franco <cf...@amsatec.fr> on 2004/02/09 16:30:52 UTC

SAX2 performance factors

Hi everybody,

I am trying to find out what impacts on the time it takes to parse an 
XML file using SAX2. The Xerces-c DLL I use was from the binary 
distribution "xerces-c2_4_0-windows_nt-msvc_60".

I'm using the sample code for "SAX2XMLReader, Constructing an XML 
Reader", provided at :
http://xml.apache.org/xerces-c/program-sax2.html

it is compiled with VC++ 6, under Windows 2000. I use it as-is to parse 
a pretty big XML file (understand, 2MB file), which is on my hard drive.

The fact is, when I run it on my dev PC, on which I have compiled it, it 
takes really long to run. It is a Pentium III 800, with 384MB of RAM 
(SDRAM). It takes about 30s to parse the file (the time needed to 
initialize the parser is neglectable, under 70ms). I tried to see if the 
hard drive had an influence, by placing the file on a distant server on 
the LAN, without any visible effect on the running time.

I've tried the same executable file on another PC under Windows 2000 
also, which is a more recent Pentium IV at 2.5Ghz, with 1GB of DDR. It 
takes... 0.4s to parse the same file. Which is much more what I was 
expecting.

I understand that the second computer is faster than the first, but we 
are talking of a speed factor of 75 here, it seems enormous to me (and 
the fact is, 30s to parse the file without doing anything of it seems 
way too long for me even if my PC is a bit old, knowing that for other 
applications there is no such performance difference between the two)

Do somebody have any idea of which factors influence the speed so much ?

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: SAX2 performance factors

Posted by Denny Vrandecic <de...@nodix.de>.
Thanks for your information! It was enlightening.

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: SAX2 performance factors

Posted by Christophe Franco <cf...@amsatec.fr>.
Denny Vrandecic wrote:
>>it is compiled with VC++ 6, under Windows 2000. I use it as-is to parse
>>a pretty big XML file (understand, 2MB file), which is on my hard drive.
> 
> 
>>The fact is, when I run it on my dev PC, on which I have compiled it, it
>>takes really long to run. It is a Pentium III 800, with 384MB of RAM
>>(SDRAM). It takes about 30s to parse the file (the time needed to
>>initialize the parser is neglectable, under 70ms). I tried to see if the
>>hard drive had an influence, by placing the file on a distant server on
>>the LAN, without any visible effect on the running time.
> 
> 
>>I've tried the same executable file on another PC under Windows 2000
>>also, which is a more recent Pentium IV at 2.5Ghz, with 1GB of DDR. It
>>takes... 0.4s to parse the same file. Which is much more what I was
>>expecting.
> 
> 
> I am just guessing, but I'd rather think, that this speed increase has more
> to do with available RAM-Size than it has to do with processor speed. This
> sounds pretty interesting. Did you try to parse different sizes of
> XML-documents, like doubling and halfing the size several times? (trying
> with a 1MB-file on both PCs, a 500 KB, a 250KB and then 4 MB, 16MB, 32MB?)
> 
> Did you make sure this is no problem with the memory or the file cache? Just
> ideas, I really don't know, what the influences are here, but I try to be
> helpful...
> 
> I would be interested in your results,

In fact, after 2 or 3 days of intense testing on a lot of different 
computers, either older or newer than mine, I realized that only my 
computer was taking 30s to parse the file, on all the others it ranged 
from 0.4 s (P IV 2.5Ghz) to about 3s (PII 450)... Even on another PC, 
exactely the same model as mine, with the same RAM, same processor, same 
everything (they were bought together), it took only 1.5s...

... and the reason was simple : the XML file was referencing a 
XML-Schema with an absolute path on *my* hard drive... That way, on any 
other computer, the parser couldn't find the XML-Schema, didn't do the 
validation, without any error message.

After solving this pretty dumb mistake, and trying again on several 
computers, they all take about the same time for parsing and validating 
the file, from 26 to 32s. And I found the reason : my schema is 
importing schemas from the web, themselves importing schemas from the 
web and so on... Therefore, the speed of the internet connexion is the 
major speed factor on my example...

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: SAX2 performance factors

Posted by Denny Vrandecic <de...@nodix.de>.
> it is compiled with VC++ 6, under Windows 2000. I use it as-is to parse
> a pretty big XML file (understand, 2MB file), which is on my hard drive.

> The fact is, when I run it on my dev PC, on which I have compiled it, it
> takes really long to run. It is a Pentium III 800, with 384MB of RAM
> (SDRAM). It takes about 30s to parse the file (the time needed to
> initialize the parser is neglectable, under 70ms). I tried to see if the
> hard drive had an influence, by placing the file on a distant server on
> the LAN, without any visible effect on the running time.

> I've tried the same executable file on another PC under Windows 2000
> also, which is a more recent Pentium IV at 2.5Ghz, with 1GB of DDR. It
> takes... 0.4s to parse the same file. Which is much more what I was
> expecting.

I am just guessing, but I'd rather think, that this speed increase has more
to do with available RAM-Size than it has to do with processor speed. This
sounds pretty interesting. Did you try to parse different sizes of
XML-documents, like doubling and halfing the size several times? (trying
with a 1MB-file on both PCs, a 500 KB, a 250KB and then 4 MB, 16MB, 32MB?)

Did you make sure this is no problem with the memory or the file cache? Just
ideas, I really don't know, what the influences are here, but I try to be
helpful...

I would be interested in your results,
best regards,
Denny


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org