[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message]

Optimizations

Michael Kay mike at saxonica.com
Fri Oct 3 16:14:27 PDT 2008


  Optimizations
I think you ran this with Saxon-B. Saxon-SA does more powerful
optimizations, and produces
 
<query>
  <globalVariables>
    <declareVariable name="level">
      <literal value="3" type="xs:integer"/>
    </declareVariable>
  </globalVariables>
  <declareFunction name="local:debug" arity="1" tailRecursive="false">
    <literal value="()"/>
  </declareFunction>
  <body>
    <let variable="dosmthg" as="element(oki,
{http://www.w3.org/2001/XMLSchema}anyType)">
      <be>
        <directElement name="oki" validation="preserve">
          <valueOf>
            <literal value="test trace" type="xs:string"/>
          </valueOf>
        </directElement>
      </be>
      <return>
        <sequence>
          <literal value="()"/>
          <variableReference name="dosmthg"/>
        </sequence>
      </return>
    </let>
  </body>
</query>
 
One of the optimizations that's done in Saxon-SA but not in Saxon-B is
function inlining.
 
Michael Kay
http://www.saxonica.com/


  _____  

From: http://x-query.com/mailman/listinfo/talk [mailto:http://x-query.com/mailman/listinfo/talk] On Behalf
Of Rémi Dewitte
Sent: 03 October 2008 14:17
To: http://x-query.com/mailman/listinfo/talk
Subject:  Optimizations


Hi,

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
    <debug>{$what}</debug>
  else ()
};

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

return
(local:debug($dosmthg),$dosmthg)



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


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.