Xerces parser XML and Visual C++ 6.0

S

Sylwester Ba³a

Hi, I have problem with Xerces can someone help me?



I have implementation Xerces in Visual C++ 6.0. Xerces is only an interface
of my application. Everything seems to be working well when I read small XML
files for example: 1, 2 or 3 size of MB. But the problem appears when I want
to read file with size of 36 MB. Application is loading this file for 13
hours :(((((

It is very slow comparing it with other smaller files. Below I put my
statistics of reading files with different sizes:

________________________________

size: 1 MB average time: 38 second

size: 9 MB average time: 44 minutes

size: 36 MB average time: 13 hours



I would like to ask, whether has someone the same problem with Xerces like
me? I would like to hear some opinions about Xerces too.



Thanks for any help and suggestions.



Best regards

Sylvek
 
A

Andy Fish

I have never tried this sort of file size but I can't say I'm surprised at
the results

DOM is intended for processing relatively small fragments of XML at a time,
as it builds a complicated structure representing the XML in memory. If you
have large amounts of XML to handle you should probably restructure your
application. It really depends what you are trying to do but here are a
couple of ideas:

Try using sax to read the XML. This is more complicated to process but will
at least give you fast (and linear) performance. If you need to manipulate
just a bit of the tree you can convert just that part to DOM, do your stuff,
then re-serialise it out later.

Alternatively you could consider an XML database. this will allow you to do
an xpath query to retrieve some subtree, then manipulate it and commit your
changes back.

Andy
 
S

Sylwester Ba³a

Hi Andy,

thanks for the answer.
Try using sax to read the XML. This is more complicated to process but will
at least give you fast (and linear) performance. If you need to manipulate
just a bit of the tree you can convert just that part to DOM, do your stuff,
then re-serialise it out later.

SAX was implemented before in this application but for some reason it was
changed on DOM. ( Don't ask me: why? )
Before this application was using the SAX, but then appeared the request to
change this structure of application to DOM.
I reckon it wasn't good idea :((((
Alternatively you could consider an XML database. this will allow you to do
an xpath query to retrieve some subtree, then manipulate it and commit your
changes back.

I will read about it because I didn't use it before. Can you let me know
where I could find some information about this.
 

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,992
Messages
2,570,220
Members
46,807
Latest member
ryef

Latest Threads

Top