Bug #1908
closedPerformance: patterns calling a function in a predicate
100%
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
Updated by O'Neil Delpratt about 11 years ago
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
- Fixed in version set to 9.5.1.3
Big fix applied in the Saxon 9.5.1.3 maintenance release.
Updated by Michael Kay almost 11 years ago
The original patch was applied to GeneralNodePattern (method analyse()). But it seems the same problem occurs in GeneralPositionalPattern. The class GeneralPositionalPattern handles a more specific class of positional patterns than GeneralNodePattern, specifically those where of the form T[P] where P is a positional predicate and T is a node-test.
A similar patch is therefore being applied to GeneralPositionalPattern.
Please register to edit this issue