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 Helen Leung <he...@yahoo.com> on 2004/06/25 04:25:53 UTC

Re: performance issue for DOMString

Dear xerces-c-dev,
 
Currently we are using xereces 1.6 to read large
XML documents.  However, we are experience performance
issue on DOM_Node::getNodeValue(),
DOM_Node::getNodeName() kind of functions.

They are constructing and destructing DOMString all
the time.
 
DOMString  DOM_Node::getNodeName()  const
{
      return fImpl->getNodeName().clone();
};
 
DOMString DOMString::clone() const
{
      DOMString retString;
 
      if (fHandle != 0)
          retString.fHandle =
this->fHandle->cloneStringHandle();
 
      return retString;
};
 
Tempted to pass in DOMString as a reference to solve
the performance problem?  Anyone has tried that path
before?  Any  trouble that may foresee on that
direction?

It will not be possible for us to switch to xerces 2.5
now since we do not have time for it.
 
Thanks for the advise.
 
Regards,
Helen



		
__________________________________
Do you Yahoo!?
Yahoo! Mail - You care about security. So do we.
http://promotions.yahoo.com/new_mail

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


Re: performance issue for DOMString

Posted by Alberto Massari <am...@progress.com>.
Hi Helen,
the clone() method is not cloning the entire string buffer; it creates a 
small structure that will point to the same buffer of the original string, 
incrementing a reference count. If you have verified that your performance 
issues are in these functions, it could be because of the excessive 
allocation/deallocations it performs (I guess because you are running a 
multithreaded program on a multiple CPU machine); in this case you could 
try switching to a SMP-friendly memory allocation routine (e.g. override 
the global operators new/delete with another implementation)

Hope this helps,
Alberto

At 19.25 24/06/2004 -0700, Helen Leung wrote:
>Dear xerces-c-dev,
>
>Currently we are using xereces 1.6 to read large
>XML documents.  However, we are experience performance
>issue on DOM_Node::getNodeValue(),
>DOM_Node::getNodeName() kind of functions.
>
>They are constructing and destructing DOMString all
>the time.
>
>DOMString  DOM_Node::getNodeName()  const
>{
>       return fImpl->getNodeName().clone();
>};
>
>DOMString DOMString::clone() const
>{
>       DOMString retString;
>
>       if (fHandle != 0)
>           retString.fHandle =
>this->fHandle->cloneStringHandle();
>
>       return retString;
>};
>
>Tempted to pass in DOMString as a reference to solve
>the performance problem?  Anyone has tried that path
>before?  Any  trouble that may foresee on that
>direction?
>
>It will not be possible for us to switch to xerces 2.5
>now since we do not have time for it.
>
>Thanks for the advise.
>
>Regards,
>Helen
>
>
>
>
>__________________________________
>Do you Yahoo!?
>Yahoo! Mail - You care about security. So do we.
>http://promotions.yahoo.com/new_mail
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
>For additional commands, e-mail: xerces-c-dev-help@xml.apache.org



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