You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by sh...@e-z.net on 2017/02/19 00:53:41 UTC

Re: Why the query \"/site/*\" is super slow?

> Dear all,
>
> I'm a Ph.D. student in Kochi University of Technology in Japan.
> I recently got started to use Xalan for some implementation work
> as a part of a project, and I encountered an efficiency problem.
> Here is the problematic function I designed for evaluating XPath
> queries.
>
> 1:  public void process(org.w3c.dom.Document doc, String xquery){
> 2:      ... // skipped some irrelevant code
> 3:      NodeList nodes = XPathAPI.selectSingleNode(doc, xquery);
> 4:      ... // skipped some irrelevant code
> 5:  }
>
> In Line 3, an XPath query is applied to an XML document. The processing
> was done on an document sized 596 MB generated by xmlgen from XMark
> project. The query is rather simple "/site/*". Since there are only six
> children of "site", it should take very short time. However, it took
> 3.6 seconds.
>
> Then I tried to evaluate it directly by the getChildNodes() function on
> the root of the document, and it took only 0.003 second for the same
> query.
> 1:   Node root = doc.getChildNodes().item(0);
> 2:   NodeList chs = root.getChildNodes();
>
> Although this efficiency was pretty good, it is hard for me to evaluate
> complex queries. I spent a couple of days trying to solve this problem,
> but still I have no idea. So, could you please give me some help about
> how to improve the efficiency of Xalan?
>
> Thank you in advance.
>
>
> Best regards,
> Wei HAO.
>
>
---
I am releasing this message to the XALAN development group.



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