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 (JIRA)" <xe...@xml.apache.org> on 2005/07/01 10:15:57 UTC
[jira] Commented: (XERCESC-1452) DOMNamedNodeMapImpl::item() 10x preformance improvement
[ http://issues.apache.org/jira/browse/XERCESC-1452?page=comments#action_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?
Thanks,
Alberto
> DOMNamedNodeMapImpl::item() 10x preformance improvement
> -------------------------------------------------------
>
> Key: XERCESC-1452
> URL: http://issues.apache.org/jira/browse/XERCESC-1452
> Project: Xerces-C++
> Type: Improvement
> Components: DOM
> Versions: 2.6.0
> Environment: All environments
> Reporter: Jeff Keasler
>
> 10 second bug fix -- change MAP_SIZE constant in DOMNamedNodeMapImpl.hpp from 193 to 17.
> I use literally millions of DomNodes each having 2-10 attributes and DOMNamedNodeMapImpl::item() is horribly implemented. It makes sense to fix the problem by changing the definition of MAP_SIZE to 17. Even people with 50 attributes will get decent performance if you make this change, wheras the vast majority of people who only use 5-10 will see up to a 10x performance improvement.
> Thank you.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org
Re: [jira] Commented: (XERCESC-1452)
DOMNamedNodeMapImpl::item() 10x preformance improvement
Posted by Alberto Massari <am...@datadirect.com>.
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
Re: [jira] Commented: (XERCESC-1452) DOMNamedNodeMapImpl::item() 10x preformance improvement
Posted by Axel Weiß <aw...@informatik.hu-berlin.de>.
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.
Cheers,
Axel
--
Humboldt-Universität zu Berlin
Institut für Informatik
Signalverarbeitung und Mustererkennung
Dipl.-Inf. Axel Weiß
Rudower Chaussee 25
12489 Berlin-Adlershof
+49-30-2093-3050
** www.freesp.de **
---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org