Where can I find these "overloads" of XMLString you speak of? In the
samples? Is that a new 2.x thing or can it be used in v1.7 ?

Thanks
David Schulze
DeLorme Mapping
Yarmouth, Maine

-----Original Message-----
From: David N Bertoni/Cambridge/IBM [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 12:31 PM
To: [EMAIL PROTECTED]
Subject: Re: XML Generation efficiency







> Hi,
> My need is to generate XML on the fly and then to store it in a memory
buffer.
> Only restriction is that I would like extremely efficient generation of
XML. I
> followed the example CreateDOMDocument and generated a XML file. For the
XML
> file I need  took about 20 seconds for the generation process (file size
10 MB).
> I also used the Class XStr mentioned in the example, which the author
mentions
> is not the most efficient way to do what is being done.

Then why use it repeatedly in a loop, with a string constant?  Replace each
use of the X macro where the string is a constant with a variable and put
the variable outside of the loop:


   const XStr     strServiceProfile("ServiceProfile");

   ...

   for (i=0; i<MAX_NUM_SERVICE_PROFILE_PER_IMPI ; i++){
   DOMElement*  ServProElem =
   doc->createElement(strServiceProfile.unicodeForm());

   ...

The next step, if that doesn't increase performance enough, would be to
replace XStr completely, as it's not a terribly efficient way to transcode,
especially if you have lots of small strings.  Look at the overload(s) of
XMLString that take a buffer for transcoding, instead of returning a newly
allocated buffer each time.

Dave


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


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

Reply via email to