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 Alberto Massari <am...@datadirect.com> on 2005/07/01 16:17:23 UTC

Re: [jira] Commented: (XERCESC-1452) DOMNamedNodeMapImpl::item() 10x preformance improvement

At 12.46 01/07/2005 +0200, Axel Weiß wrote:
>Alberto Massari (JIRA) wrote:
> >     [
> > http://issues.apache.org/jira/browse/XERCESC-1452?page=comments#actio
> >n_12314869 ]
> >
> > Alberto Massari commented on XERCESC-1452:
> > ------------------------------------------
> >
> > Hi Jeff,
> > the DOMNamedNodeMapImpl class is not used to store attributes in an
> > element (that's DOMAttrMapImpl); it is used to store the list of
> > entities, notations and elements in a DTD. Can you double check why
> > reducing the size of these 3 maps improves your performances?
>
>Hi Alberto,
>
>querying all attributes of an element, is done by the loop:
>
>DOMNamedNodeMap *map = node->getAttributes();
>if (map){
>         int i, size = map->Length();
>         for (i=0; i<size; ++i){
>                 DOMNode *attr = map->item(i);
>                 // ...
>         }
>}
>
>As I understand, the performance improvement here is made with respect
>to the item(.) method (which is called size times and that's why it's
>improvement is important), and not with respect to the internal
>attribute handling of xerces.

Hi Axel,

that code queries the attributes through an 
interface (DOMNamedNodeMap), but it is actually 
talking to an object of type DOMAttrMapImpl; the 
fix he suggests is for the class 
DOMNamedNodeMapImpl, but that will never store 
attributes, only nodes stored in the DTD. The 
only place where DOMNamedNodeMapImpl::item() is 
invoked should be only when cloning the DTD node or if he does it in his code.

Alberto 



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