About Arbortext Styler > Debugging Stylesheets > Performance Profiling for Arbortext Styler or FOSI Stylesheets > Functional Areas of Diagnostic Output
  
Functional Areas of Diagnostic Output
Once the diagnostic output has been written to the selected file, you will see data relating to one or all of the following types for each occurrence of each element defined for the document. (See Sample Output of set debug Command for an example output file that contains performance data against all three types.) Each line in the output file contains a particular type of information for an element in the document, giving the number of occurrences of that element in the document (events), the total time to process all of those occurrences, and hence the average time for processing a single occurrence.
As already explained, the data is divided into four main types. The list below contains suggestions as to what could be causing the problem with your stylesheet if you have isolated the issue to one of these functional areas:
Context/e-i-c matching
If context/eic matching is slow, it is almost always due to the use of XPath predicates. There may be one slow phrase in one predicate that is slowing the whole document, or it may be the case that there are so many expressions that their combined processing time is extremely slow.
It is useful to note the number of context matching passes that may be involved to complete an action being taken with the document - this may give you an indication of why a perceived slowdown is occurring:
When updating generated text, context matching usually happens once per element for most of the elements in the document: although multiple matches may be required for some elements
When the document is published for print, content matching occurs at least twice for every element in the document, as well as a subsequent pass for each element in each header and footer in each page of the document.
Condition/att matching
There are two common sources of slowness with condition/att matching processes:
The use of particular XPath tests: see XPath Performance for the types of test that will cause marked slowdowns in document processing
The inclusion of edited FOSI source that uses <specval attloc="system-func" .../> to call ACL functions. ACL functions are generally fast, but if they make use of the particular XPath expressions described in XPath performance, they will be considerably slower.
The number of condition/att matching passes that may be involved to complete an action being taken with the document is similar to that required for context/eic matching. Again, this may give you an indication of why processing is slow.
Generated text processing
Slow processing of generated text is almost always due to the use of one of the following functions in Arbortext Styler's Generated Text Editor:
Insert > XPath String
Insert > Element Content - in this instance most cases are fast, but some combinations of parameters can be slow:
Electing to choose the element using an XPath expression, via the By XPath field.
Electing to search for a specific occurrence of an element within another element, rather than searching for it within the root document element.
For these instances it is useful to refer to XPath Performance for a list of expressions that commonly cause a marked slowdown of generated text processing.
It is also useful to note the number of generated text processing passes that may be involved to complete an action being taken with the document - this may give you an indication of why a perceived slowdown is occurring:
When updating generated text, generated text processing happens once for every element in the document.
When the document is published for print, generated text processing occurs once for every element in the document, as well as a subsequent pass for each element in each header and footer on each page of the document
Evaluation of XPath expressions
It may be the case that a single XPath expression takes extensive processing time. It may also be true that there are so many instances of an expression in a stylesheet that combined processing time is slow. The 11.10 flag for an PTC ALD publishing action outputs information about XPath processing, allowing you to identify occurrences that are causing slowdown in formatting/publishing:
Debugging with this flag lists information about each XPath expression:
Node name
Total time taken to process the expression
Count of times the expression was evaluated
Maximum processing time for a single evaluation
* 
If there are multiple formatting passes, eic matching, att matching, and (less frequently) generated text processing are sometimes repeated for the second pass. Header and footer processing, however, is always repeated for each page for the second pass.