SAXONICA

Saxon Documentation
Full Contents
About Saxon
Changes in this Release
Conditions of Use
Using XSLT 2.0
| Using XSLT 2.0 Stylesheets
| Running XSLT from the Command Line
| Compiling a Stylesheet
| Choosing a Tree Model
| Invoking XSLT from Java
» | Performance Analysis
Using XQuery
Handling Source Documents
XML Schema Processing
The XPath API
Standards Conformance
Extensibility
Saxon Extensions
Sample Saxon Applications
The Saxon SQL Extension
XSLT Elements
XPath 2.0 Expression Syntax
Function Library
XSLT Patterns

# Performance Analysis

Saxon comes with a simple tool allowing profiling of the execution time in a stylesheet.

To run this tool, first execute the transformation with the `-TP` option, which sends timed tracing information to the standard error output file:

java -jar dir/saxon8.jar -TP source stylesheet 2>profile.xml

Then run another transformation to create a profile report from the output of this tracing tool (the stylesheet can be found in the directory `samples/analysis`):

java -jar dir/saxon8.jar profile.xml timing-profile.xsl >profile.html

Finally, view the resulting `profile.html` file in your browser.

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.