Project

Profile

Help

Bug #1908

closed

Performance: patterns calling a function in a predicate

Added by Michael Kay about 11 years ago. Updated almost 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Performance
Sprint/Milestone:
-
Start date:
2013-09-20
Due date:
% Done:

100%

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

Description

When an XSLT pattern contains a predicate that calls a function, for example

match="a[is-interesting(.)]"

the pattern is classified and compiled before it is determined that the function returns a boolean. As a result, the compiled form of the pattern assumes that the function is capable of returning an integer, which would make it dependent of the position of the "a" element relative to its siblings. Such "positional" patterns are very expensive to evaluate compared with pure boolean patterns. In the case that led to this bug report, stylesheet execution time increased from around 1 second to around 2 minutes as a result.

A patch is being placed in Subversion. The effect of the patch is to re-evaluate whether the predicate is positional at a later stage of analysis and recompile the pattern if so.


Related issues

Related to Saxon - Bug #1942: Function current should have been resolved at compile timeClosedMichael Kay2013-12-02

Actions
Related to Saxon - Bug #1992: Template pattern incorrectly identified as never matchingClosedMichael Kay2014-01-30

Actions

Please register to edit this issue

Also available in: Atom PDF