[xquery-talk] Optimizations

Rémi Dewitte remi at gide.net
Fri Oct 3 16:17:13 PDT 2008


I have made a little experiment after reading Michael (Kay) blog posts about
optimizations and recent James Fuller article.

I have a question quite specific to saxon still interesting in general.

Why in the following example even the function call is not skipped ?

XQuery is ::

declare variable $level := 3;

declare function local:debug($what){
  if($level >=4) then
  else ()

let $dosmthg := <oki>test trace</oki>


When I run saxon with -explain we get

    <declareVariable name="level">
      <literal value="3" type="xs:integer"/>
  <declareFunction name="local:debug" tailRecursive="false">
    <literal value="()"/>
    <let variable="dosmthg" as="element(oki, {
        <directElement name="oki" validation="skip">
            <literal value="test trace" type="xs:string"/>
          <functionCall name="local:debug" tailCall="false">
            <variableReference name="dosmthg"/>
          <variableReference name="dosmthg"/>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://x-query.com/pipermail/talk/attachments/20081003/a4459d62/attachment.htm

More information about the talk mailing list