You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Nicolas Albert (JIRA)" <xa...@xml.apache.org> on 2008/09/22 10:56:44 UTC

[jira] Created: (XALANJ-2459) XSLTC transformation 200 times slower than pure Xalan

XSLTC transformation 200 times slower than pure Xalan
-----------------------------------------------------

                 Key: XALANJ-2459
                 URL: https://issues.apache.org/jira/browse/XALANJ-2459
             Project: XalanJ2
          Issue Type: Bug
      Security Level: No security risk; visible to anyone (Ordinary problems in Xalan projects.  Anybody can view the issue.)
          Components: XSLTC
    Affects Versions: 2.7.1
         Environment: Java Sun JVM 1.5 and 1.6 on Linux 32 & 64 bit and Windows XP 32 bit. (Core2Duo & Pentium4)
            Reporter: Nicolas Albert
            Priority: Critical


I have an XSL stylesheet that perfom the transformation very very very slow with XSLTC.

20 sec with no much data (vs 100 ms with Xalan), and I have never see it success with the real amont of data (vs 900 ms with Xalan).

I'll attach the xsl and a small xml.

-- 
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


[jira] Commented: (XALANJ-2459) XSLTC transformation 200 times slower than pure Xalan

Posted by "Cristian Vat (JIRA)" <xa...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XALANJ-2459?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12847158#action_12847158 ] 

Cristian Vat commented on XALANJ-2459:
--------------------------------------

I made a quick test and it seems much can be improved in the stylesheet given as example just by caching the result of the XPath expression "following-sibling::evenement[not(numEvt=$num and date=$date)][1]" or by applying the selection of the first node differently.

My results on current stylesheet and the improved ones:
--
Checking with initial stylesheet.
[XSLT] Average time (per transformation) for 20 transformations: 21.9 ms.
[XSLTC] Average time (per transformation) for 20 transformations: 10222.85 ms.
Checking with improved stylesheet.
[XSLT] Average time (per transformation) for 20 transformations: 9.2 ms.
[XSLTC] Average time (per transformation) for 20 transformations: 5.4 ms.
Checking with second (alternative) improved stylesheet.
[XSLT] Average time (per transformation) for 20 transformations: 8.35 ms.
[XSLTC] Average time (per transformation) for 20 transformations: 3.0 ms.
--

The first "improved" stylesheet just creates a variable with the result of "following-sibling::evenement[not(numEvt=$num and date=$date)][1]" and then uses that for the apply-templates and with-param calls.
The second improved stylesheet just changes the XPath from "following-sibling::evenement[not(numEvt=$num and date=$date)][1]" to "(following-sibling::evenement[not(numEvt=$num and date=$date)])[1]". Results are always the same.

While it's interesting that XSLTC behaves very slow for the example, it's really not a good example since the XPaths aren't optimized. With the better stylesheets XSLTC is always faster than the normal transformation.

> XSLTC transformation 200 times slower than pure Xalan
> -----------------------------------------------------
>
>                 Key: XALANJ-2459
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2459
>             Project: XalanJ2
>          Issue Type: Bug
>      Security Level: No security risk; visible to anyone(Ordinary problems in Xalan projects.  Anybody can view the issue.) 
>          Components: XSLTC
>    Affects Versions: 2.7.1
>         Environment: Java Sun JVM 1.5 and 1.6 on Linux 32 & 64 bit and Windows XP 32 bit. (Core2Duo & Pentium4)
>            Reporter: Nicolas Albert
>            Priority: Critical
>         Attachments: xsltcbug.xml, xsltcbug.xsl
>
>
> I have an XSL stylesheet that perfom the transformation very very very slow with XSLTC.
> 20 sec with no much data (vs 100 ms with Xalan), and I have never see it success with the real amont of data (vs 900 ms with Xalan).
> I'll attach the xsl and a small xml.

-- 
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


[jira] Commented: (XALANJ-2459) XSLTC transformation 200 times slower than pure Xalan

Posted by "Nicolas Albert (JIRA)" <xa...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XALANJ-2459?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12669665#action_12669665 ] 

Nicolas Albert commented on XALANJ-2459:
----------------------------------------

It's very simple to reproduce :

java -cp xsltc.jar org.apache.xalan.xsltc.cmdline.Compile xsltcbug.xsl
java -cp xsltc.jar:. org.apache.xalan.xsltc.cmdline.Transform xsltcbug.xml xsltcbug

If I try with current svn version, I got this :

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/xalan/xsltc/cmdline/Transform
Caused by: java.lang.ClassNotFoundException: org.apache.xalan.xsltc.cmdline.Transform
	at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:336)
Could not find the main class: org.apache.xalan.xsltc.cmdline.Transform. Program will exit.

> XSLTC transformation 200 times slower than pure Xalan
> -----------------------------------------------------
>
>                 Key: XALANJ-2459
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2459
>             Project: XalanJ2
>          Issue Type: Bug
>      Security Level: No security risk; visible to anyone(Ordinary problems in Xalan projects.  Anybody can view the issue.) 
>          Components: XSLTC
>    Affects Versions: 2.7.1
>         Environment: Java Sun JVM 1.5 and 1.6 on Linux 32 & 64 bit and Windows XP 32 bit. (Core2Duo & Pentium4)
>            Reporter: Nicolas Albert
>            Priority: Critical
>         Attachments: xsltcbug.xml, xsltcbug.xsl
>
>
> I have an XSL stylesheet that perfom the transformation very very very slow with XSLTC.
> 20 sec with no much data (vs 100 ms with Xalan), and I have never see it success with the real amont of data (vs 900 ms with Xalan).
> I'll attach the xsl and a small xml.

-- 
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


[jira] Issue Comment Edited: (XALANJ-2459) XSLTC transformation 200 times slower than pure Xalan

Posted by "Cristian Vat (JIRA)" <xa...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XALANJ-2459?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12847158#action_12847158 ] 

Cristian Vat edited comment on XALANJ-2459 at 3/18/10 11:18 PM:
----------------------------------------------------------------

I made a quick test and it seems much can be improved in the stylesheet given as example just by caching the result of the XPath expression "following-sibling::evenement[not(numEvt=$num and date=$date)][1]" or by applying the selection of the first node differently.

My results on current stylesheet and the improved ones (Xalan-J 2.7.1, JDK 1.6.0_17_x64, Win7_x64):
--
Checking with initial stylesheet.
[XSLT] Average time (per transformation) for 20 transformations: 21.9 ms.
[XSLTC] Average time (per transformation) for 20 transformations: 10222.85 ms.
Checking with improved stylesheet.
[XSLT] Average time (per transformation) for 20 transformations: 9.2 ms.
[XSLTC] Average time (per transformation) for 20 transformations: 5.4 ms.
Checking with second (alternative) improved stylesheet.
[XSLT] Average time (per transformation) for 20 transformations: 8.35 ms.
[XSLTC] Average time (per transformation) for 20 transformations: 3.0 ms.
--

The first "improved" stylesheet just creates a variable with the result of "following-sibling::evenement[not(numEvt=$num and date=$date)][1]" and then uses that for the apply-templates and with-param calls.
The second improved stylesheet just changes the XPath from "following-sibling::evenement[not(numEvt=$num and date=$date)][1]" to "(following-sibling::evenement[not(numEvt=$num and date=$date)])[1]". Results are always the same.

While it's interesting that XSLTC behaves very slow for the example, it's really not a good example since the XPaths aren't optimized. With the better stylesheets XSLTC is always faster than the normal transformation.

      was (Author: cristian.vat):
    I made a quick test and it seems much can be improved in the stylesheet given as example just by caching the result of the XPath expression "following-sibling::evenement[not(numEvt=$num and date=$date)][1]" or by applying the selection of the first node differently.

My results on current stylesheet and the improved ones:
--
Checking with initial stylesheet.
[XSLT] Average time (per transformation) for 20 transformations: 21.9 ms.
[XSLTC] Average time (per transformation) for 20 transformations: 10222.85 ms.
Checking with improved stylesheet.
[XSLT] Average time (per transformation) for 20 transformations: 9.2 ms.
[XSLTC] Average time (per transformation) for 20 transformations: 5.4 ms.
Checking with second (alternative) improved stylesheet.
[XSLT] Average time (per transformation) for 20 transformations: 8.35 ms.
[XSLTC] Average time (per transformation) for 20 transformations: 3.0 ms.
--

The first "improved" stylesheet just creates a variable with the result of "following-sibling::evenement[not(numEvt=$num and date=$date)][1]" and then uses that for the apply-templates and with-param calls.
The second improved stylesheet just changes the XPath from "following-sibling::evenement[not(numEvt=$num and date=$date)][1]" to "(following-sibling::evenement[not(numEvt=$num and date=$date)])[1]". Results are always the same.

While it's interesting that XSLTC behaves very slow for the example, it's really not a good example since the XPaths aren't optimized. With the better stylesheets XSLTC is always faster than the normal transformation.
  
> XSLTC transformation 200 times slower than pure Xalan
> -----------------------------------------------------
>
>                 Key: XALANJ-2459
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2459
>             Project: XalanJ2
>          Issue Type: Bug
>      Security Level: No security risk; visible to anyone(Ordinary problems in Xalan projects.  Anybody can view the issue.) 
>          Components: XSLTC
>    Affects Versions: 2.7.1
>         Environment: Java Sun JVM 1.5 and 1.6 on Linux 32 & 64 bit and Windows XP 32 bit. (Core2Duo & Pentium4)
>            Reporter: Nicolas Albert
>            Priority: Critical
>         Attachments: xsltcbug.xml, xsltcbug.xsl
>
>
> I have an XSL stylesheet that perfom the transformation very very very slow with XSLTC.
> 20 sec with no much data (vs 100 ms with Xalan), and I have never see it success with the real amont of data (vs 900 ms with Xalan).
> I'll attach the xsl and a small xml.

-- 
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