You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Henry Zongaro (JIRA)" <xa...@xml.apache.org> on 2009/12/12 05:10:18 UTC

[jira] Commented: (XALANJ-2502) Some serious performance issues with XPathAPI processing

    [ https://issues.apache.org/jira/browse/XALANJ-2502?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12789674#action_12789674 ] 

Henry Zongaro commented on XALANJ-2502:
---------------------------------------

Hi, Pradip.  Sorry for the very long delay in responding.  I don't know whether it's still relevant for you, but I thought I'd respond anyway.

The Xalan-J processors operate on their own internal representation of the XPath data model called DTM.  The DTM is a read-only model and doesn't support mutation of the input representation.  The XPathAPI class assumes that any DOM tree supplied might change from one evaluation of an XPath expression to the next, so it rebuilds the entire DTM data structure every time an XPath expression is evaluated.

Xalan 1.x operated directly on DOM trees, so it didn't need to go through that step of building a DTM instance.  That's why it usually operated so much faster on DOM.

If your DOM trees do not change between evaluating one XPath expression and the next, you can use the CachedXPathAPI class to evaluate your XPath expressions.  By using that class you are guaranteeing that the DOM trees supplied do not change; the implementation of CachedXPathAPI will build a DTM instance for any given DOM tree only one time.

I hope that helps.

> Some serious performance issues with XPathAPI processing
> --------------------------------------------------------
>
>                 Key: XALANJ-2502
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2502
>             Project: XalanJ2
>          Issue Type: Bug
>      Security Level: No security risk; visible to anyone(Ordinary problems in Xalan projects.  Anybody can view the issue.) 
>          Components: XPath-API
>    Affects Versions: 2.2.x
>         Environment: Win Xp, Java 5, xalan-2.7.1, xerces-2.9.0
>            Reporter: pradip sonar
>            Priority: Critical
>
> I am facing some serious performance issues with XPathAPI processing using 
> the latest releases of Xalan (xalan-2.7.1). I am using Xerses release xerces-2.9.0.
> I tried a very simple test case which attempts using a DOM document 
> which consists of about 1000 sibling elements directly beneath the document 
> root node.
> I query this file by getting a 1000 element NodeList from the root 
> using XPathAPI.selectNodeList() and subsequently querying each of the 1000 
> nodes with 4 calls to XPathAPI.selectSingleNode() in order to get the 
> attribute and node values.
> Using the first releases of Xalan 1.x, this was 
> accomplished in under very few seconds. Using the current releases, noted above, 
> this takes up to few minutes!.
> Does anyone know anything about this, are others having these probems?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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