Project

Profile

Help

Bug #4346

closed

Streamed optimization of xsl:copy doesn't converge

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

Status:
Closed
Priority:
Low
Assignee:
Category:
Streaming
Sprint/Milestone:
-
Start date:
2019-10-18
Due date:
% Done:

0%

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

Description

Given a streamed xsl:copy instruction where the node kind that it applies to can't be determined statically, the expression is split into two:

if (kind = (attribute, namespace, text, comment, pi))
  then copy-of(.)
  else copy(....)

But typically the result goes through the optimizer more than once, and on the second pass through it becomes:

if (kind = (attribute, namespace, text, comment, pi))
  then copy-of(.)
  else if (kind = (attribute, namespace, text, comment, pi))
  then copy-of(.)
  else copy(....)

with the number of branches in the conditional increasing on each pass through the optimizer.

Seen in test case si-apply-templates-010.

Actions #1

Updated by Michael Kay over 4 years ago

On the development branch, did a rather ad-hoc fix to Copy.optimize() where it tries to detect whether the optimization has already been done, and refrains from doing it again.

Actions #2

Updated by Michael Kay over 4 years ago

  • Category set to Streaming
  • Status changed from New to Resolved
  • Applies to branch 9.9, trunk added
  • Fix Committed on Branch 9.9, trunk added

It's difficult to come up with a better fix. Ideally if the first branch of a conditional says "test=". instance of X" then we know in subsequent branches that the context item isn't an instance of X; but doing that would be a significant step forward in our current type inferencing logic.

So I'm resolving it with this rather simplistic fix.

Actions #3

Updated by O'Neil Delpratt over 4 years ago

  • Status changed from Resolved to Closed
  • Fixed in Maintenance Release 9.9.1.6 added

Patch committed to the Saxon 9.9.1.6 maintenance release.

Please register to edit this issue

Also available in: Atom PDF