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 "Scott Cantor (JIRA)" <xe...@xml.apache.org> on 2018/03/12 02:34:00 UTC

[jira] [Closed] (XERCESC-1788) DOMParser API getting slow

     [ https://issues.apache.org/jira/browse/XERCESC-1788?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Scott Cantor closed XERCESC-1788.
---------------------------------

> DOMParser API getting slow
> --------------------------
>
>                 Key: XERCESC-1788
>                 URL: https://issues.apache.org/jira/browse/XERCESC-1788
>             Project: Xerces-C++
>          Issue Type: Bug
>          Components: DOM
>    Affects Versions: 2.7.0
>         Environment: Windows XP, VC++ 6
>            Reporter: Sanish Kanjany
>            Priority: Major
>
> I have been using xerces-c2.2 for a long and now moved to xerces-c2.7. I was using deprecated DOM_Parser(with 2.2) and now using XercesDOMParser(with 2.7) itself. I had to write some wrappers for DOMNode, DOMDocument, DOMNodeList etc to avoid changes in my existing code as DOM_Node, DOM_Document, DOM_NodeList etc. I could see the parsing time is significantly reduced with xerces-2.7.  But some APIs to the parser is getting slow down. 
> For example,  in the function given below, to  get all element children of a node, is very slow when the reference node has a large number of child nodes. The function spends more time inside the for loop. The same function is very fast with old version of xerces-c(2.2).
> bool CMyDomParser::GetAllChildNodes(DOM_Node node, std::vector<DOM_Node>& nodes)
> {
> 	nodes.clear();
> 	if(node == NULL)
> 		return false;
> 	DOM_NodeList nodelist = node.getChildNodes();
> 	if(nodelist == NULL)
> 		return true;
> 	bool retval = false;
> 	int iLisSize=nodelist.getLength();
> 	for(int i=0; i < iLisSize; i++)
> 	{
> 		DOM_Node oTempNode=nodelist.item(i);
> 		if(oTempNode.getNodeType() != DOM_Node::ELEMENT_NODE)
> 			continue;
> 		retval = true;
> 		nodes.push_back(oTempNode);
> 	}
> 	return true;
> }
>  What will be the base reason ? 
> Anyadvancement needed in my code?  
> Is there any change in implementation of DOMNodelist ::item(int) ?
> Thanks,
> Sanish



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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