12.1 XSL evaluation no longer lazy, now very slow

Having trouble installing Oxygen? Got a bug to report? Post it all here.
Eiríkr
Posts: 7
Joined: Mon Nov 19, 2007 6:53 pm
Location: Puget Sound

12.1 XSL evaluation no longer lazy, now very slow

Post by Eiríkr »

I've been doing some XSLT work for a bit, and have run into some serious speed issues with 12.1. I'm hoping it's just that a default setting value is different now, and that someone can point me to it.

SETUP:
OxygenXML 12.1 on fully updated Win XP.

XSL:
The XSL sheets in question define lots of complicated global variables. Running the whole thing is slow, there's no way about it. BUT -- evaluating just one of these global vars (such as when debugging) used to be very fast, using code like the following:

Code: Select all

    <xsl:template match="/">
<mtf>
<TEST>
<xsl:copy-of select="$IMGS"/>
</TEST>
</mtf>
</xsl:template>
In previous Oxygen versions, the XSL engine would evaluate *only* what was needed to spit out what was asked for. I.e., if $IMGS doesn't reference other global variables, those other global vars would not be evaluated.

Now, Oxygen's underlying XSL engine seems to evaluate the *whole* thing. The only real differences I can find are 1) I upgraded to 12.1, and 2) I've refactored some content to a different "Common.xsl" file that I import.

QUESTIONS:
1) Does importing cause Oxygen to evaluate *everything*, even when only asking for partial evaluation, as in the sample above?
2) Is there some different setting in version 12.1 that I've missed?
3) Maybe I missed something else?

The possibility that importing is causing the difference just occurred to me (I only just refactored this stuff yesterday). I don't have time right now to un-refactor (defactor?) back to avoid importing, but I'll look into that later and post back here if I find anything.

Any constructive advice in the meantime would be more than welcome. :)

Cheers,

-- Eiríkr
adrian
Posts: 2879
Joined: Tue May 17, 2005 4:01 pm

Re: 12.1 XSL evaluation no longer lazy, now very slow

Post by adrian »

Hello,

What version of Oxygen did you use before updating to v12.1?
Do you still have or could you install the old version of Oxygen side by side with 12.1 and check if it still behaves in the same way in the old version?
The refactoring can affect the way the XSLT processor optimizes the code so that is actually a possible reason for the different behavior.

Oxygen has several XSLT processors built-in/bundled and they are updated frequently. Other than that their policy hasn't changed, but different transformers will behave differently.

Which XSLT Transformer(processor/engine) are you currently using?
You can check this in your transformation scenario(Document -> Transformation -> Configure Transformation Scenario, Edit)

If you are using Saxon-HE/PE/EE, check the "Optimization level" in Options -> Preferences -> XML -> XSLT-FO-XQuery -> XSLT -> Saxon -> Saxon-HE/PE/EE and in the transformation scenario editing dialog, the "Advanced options" button(a cogwheel button to the right of the Transformer combo). The "Optimization level" should be set to 10 if you don't want the unused code to be evaluated.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Eiríkr
Posts: 7
Joined: Mon Nov 19, 2007 6:53 pm
Location: Puget Sound

Re: 12.1 XSL evaluation no longer lazy, now very slow

Post by Eiríkr »

Hello Adrian --

Sorry for the delay, been sick for a few days.

Thanks for the reply. I've been using Oxygen for years now; I forget what version I started with. I've been pretty regular about updating, generally only lagging the official release date by a few weeks at most.

Anyway, I've kept the transformation engine as the default Saxon one, and sure enough the optimization level is set to 10.

That said, I just tried running a similar debug transform using a different all-in-one non-refactored XSL file, and it returned much more quickly without evaluating non-essential code. (Incidentally, thank you all for adding the "Show current execution nodes" button. :)) So it seems like different rules apply when using an <xsl:import> statement. I'll experiment on my end and see what I can do with my own code to optimize.

Thanks again,

-- Eiríkr
Post Reply