Project

Profile

Help

Bug #2307

closed

Optimization disabled in 1.0 compatibility mode

Added by Michael Kay almost 10 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Performance
Sprint/Milestone:
Start date:
2015-02-03
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
9.6
Fix Committed on Branch:
9.6
Fixed in Maintenance Release:
Platforms:

Description

Saxon-EE attempts to optimize expressions such as //*[@name=$xyz] to use a document-level index (in effect, a system-generated xsl:key definition).

In 9.6, this optimization is disabled if the expression is in 1.0 compatibility mode. In 9.5, this was not the case, creating a performance regression for affected stylesheets.

There are some cases where disabling the optimization is legitimate, and it was almost certainly done to eliminate bugs. However, doing this for all expressions in 1.0 mode is overkill.

Cases where the optimization does not work include all cases where the fixed comparand ($xyz in the above example) might turn out to be boolean or numeric, because the semantics of the "=" operator in 1.0 mode for such cases make indexing highly complex. (A more elaborate optimization would generate code that builds indexes selectively based on the run-time type of the expression). But Saxon already works out cases where there is enough type information to know that the 2.0 comparison semantics can be used, and in such cases suppressing the optimisation is unnecessary.

The same applies to variable-level indexes used for expressions such as @$x[@name=$abc]@.

Please register to edit this issue

Also available in: Atom PDF