You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by xa...@xml.apache.org on 2004/09/24 17:30:50 UTC
[jira] Updated: (XALANJ-1229) Performance problem with Xalan 2.0 -> 2.4
The following issue has been updated:
Updater: Brian Minchau (mailto:minchau@ca.ibm.com)
Date: Fri, 24 Sep 2004 8:30 AM
Changes:
Component changed to transformation
---------------------------------------------------------------------
For a full history of the issue, see:
http://issues.apache.org/jira/browse/XALANJ-1229?page=history
---------------------------------------------------------------------
View the issue:
http://issues.apache.org/jira/browse/XALANJ-1229
Here is an overview of the issue:
---------------------------------------------------------------------
Key: XALANJ-1229
Summary: Performance problem with Xalan 2.0 -> 2.4
Type: Bug
Status: Open
Project: XalanJ2
Components:
Xalan-interpretive transformation
transformation
Versions:
2.4
Assignee: Xalan Developers Mailing List
Reporter: Kees Kuip
Created: Sun, 13 Oct 2002 9:55 AM
Updated: Fri, 24 Sep 2004 8:30 AM
Environment: Operating System: Other
Platform: All
Description:
When trying out xalan 2.4 I see a large performance problem with
my application.
My application :
I use domify (http://domify.sourceforge.net/) to build a DOM tree from
a JavaBean hierarchy. The DOM tree is build 'lazy'. That is : Only when
the elements are needed they are created.
The hierary is as follows:
RegistrationRoot
+--RegistrationYear
+---RegistrationProductionLine
+---RegistrationYear
+---RegistrationMonth
+---RegistrationBatch
- RegistrationRoot has a number of RegistrationYear(s).
- RegistrationYear has a number of RegistrationProductionLine(s)
- etc.
- RegistrationYear has an element "Year".
My XSLT:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html"/>
<xsl:template match="/">
<xsl:apply-templates select="RegistrationRoot"/>
</xsl:template>
<xsl:template match="RegistrationRoot">
</xsl:template>
</xsl:stylesheet>
(I know this stylesheet does nothing, but it's good for showing the problem)
My problem:
In myXSLT you see that I only apply a template to RegistrationRoot.
So in my opinion it is not necessary to visit the children of the
RegistrationRoot element.
It seems that during the transformation xalan 2.4 visits each and every element of
the DOM-tree. This behaviour is not found in xalan 2.0 ! (The perfomance degradation
i'm experiencing is that now all my 'lazy' elements are instantiated !)
I printed out a stacktrace when the element "RegistrationMonth" is visited.
Its shows that the xalan-program is walking the tree (and not domify). So this is to
show that domify is not the problem. I think xalan is.
java.lang.Throwable
at gti.batch.registration.RegistrationMonth.getBatches(RegistrationMonth.java:74)
at java.lang.reflect.Method.invoke(Native Method)
at
org.infohazard.domify.ElementAdapter$MethodNodeListAdapter.item(ElementAdapter.java:89)
at org.infohazard.domify.NodeAdapter.getNextSibling(NodeAdapter.java:151)
at org.apache.xml.dtm.ref.dom2dtm.DOM2DTM.nextNode(DOM2DTM.java:421)
at org.apache.xml.dtm.ref.DTMDefaultBase._nextsib(DTMDefaultBase.java:560)
at org.apache.xml.dtm.ref.DTMDefaultBase.getNextSibling(DTMDefaultBase.java:1057)
at
org.apache.xml.dtm.ref.DTMDefaultBaseTraversers$ChildTraverser.next(DTMDefaultBaseTraversers.java:472)
at org.apache.xpath.axes.ChildTestIterator.getNextNode(ChildTestIterator.java:124)
at org.apache.xpath.axes.BasicTestIterator.nextNode(BasicTestIterator.java:150)
at org.apache.xpath.axes.NodeSequence.nextNode(NodeSequence.java:320)
at
org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:311)
at
org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:216)
at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2331)
at
org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2152)
at
org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1205)
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:660)
at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1121)
at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1099)
at Test2.execute(Test2.java:54)
at Test2.main(Test2.java:161)
So basically my problem is :
- When transforming a document xalan visits each and every node of the DOM-tree,
even
when my XPath-query only operates on the first children of the root-element.
Kees Kuip.
---------------------------------------------------------------------
JIRA INFORMATION:
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
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org