Project

Profile

Help

Bug #3945

closed

Poor optimization of `$doc1/descendant-or-self::node()/child::node()`

Added by Michael Kay over 5 years ago. Updated over 5 years ago.

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

100%

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

Description

The expression $doc1/descendant-or-self::node()/child::node() arises in the generated XSLT code produced by conversion of the QT3 test fn-innermost-053.

Here $doc1 has unknown type.

In Saxon 9.8 the composite path expression is translated to

conditionalSort(xxx, docOrder(($doc1 treat as node())/descendant::node())

Saxon 9.9 does not succeed in reducing the path expression to a single axis step in this way.

The advantage of rewriting descendant-or-self::node()/child::node() as descendant::node() is that the latter naturally delivers nodes in document order; it is also a faster traversal of the TinyTree.

Please register to edit this issue

Also available in: Atom PDF