<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet href="../make-menu.xsl" type="text/xsl"?><html>
   <head>
      <this-is section="using-xsl" page="performanceanalysis" subpage=""/>
      <!--
           Generated at 2010-10-29T18:20:48.427+01:00--><title>Saxonica: XSLT and XQuery Processing: Performance Analysis</title>
      <meta name="coverage" content="Worldwide"/>
      <meta name="copyright" content="Copyright Saxonica Ltd"/>
      <meta name="title"
            content="Saxonica: XSLT and XQuery Processing: Performance Analysis"/>
      <meta name="robots" content="noindex,nofollow"/>
      <link rel="stylesheet" href="../saxondocs.css" type="text/css"/>
   </head>
   <body class="main">
      <h1>Performance Analysis</h1>
      <p>Saxon comes with a simple tool allowing profiling of the execution time in a stylesheet.</p>
      <p>To run this tool, first execute the transformation with the <code>-TP:filename</code> option, which 
sends timed tracing information to the specified file (or to the standard error output if no filename is given)</p>
      <p class="command">java   -jar   <i>dir</i>/saxon9he.jar  
 -TP:profile.xml   <i>source</i>   <i>stylesheet</i>
      </p>
      <p>Then run another transformation to create a profile report from the output of this tracing tool 
(the stylesheet can be found in the directory <code>samples/analysis</code>, 
installed from the <code>saxon-resources</code> download collection.):</p>
      <p class="command">java   -jar   <i>dir</i>/saxon9he.jar  
 profile.xml   timing-profile.xsl   &gt;profile.html</p>
      <p>Finally,  view the resulting <code>profile.html</code> file in your browser.</p>
      <p>The output identifies instructions in the original stylesheet by their name, line number, and the last
few characters of the URI of their module. For each instruction it gives the number of times the instruction
was executed, the average time in milliseconds of each execution, and the total time. The table is sorted
according to a weighting function that attempts to put the dominant instructions at the top. These will
not necessarily be those with the greatest time, which tend to be instructions that were only executed once
but remained active for the duration of the transformation.</p>
      <table width="100%">
         <tr>
            <td>
               <p align="right"><a class="nav" href="xslt30.xml">Next</a></p>
            </td>
         </tr>
      </table>
   </body>
</html>