Project

Profile

Help

Bug #2077

Performance: $x[$x[$i]] with bytecode enabled

Added by Michael Kay about 6 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Normal
Category:
Byte code generation
Sprint/Milestone:
-
Start date:
2014-05-20
Due date:
% Done:

100%

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

Description

From Gunther Rademacher on saxon-help list

Recently I ran some tests with a REx parser on Saxon-EE and I noticed a

performance degradation that occurs with -opt:10, when byte code is

generated.

Tried to isolate it as much as possible, which resulted in the small

program below. The $x[$x[$i]] construct presumably causes the

degradation, something similar is used in a REx lexer's state machine.

  declare variable $n external;

  declare variable $x := 1 to $n;

  avg(for $i in $x return $x[$x[$i]])

With $n=65536, it executes in about 8 milliseconds. Unless byte code

generation is in effect, in which case it takes 8 seconds.

History

#1 Updated by O'Neil Delpratt about 6 years ago

  • Status changed from New to In Progress

I managed to reproduce the performance issue with the byte code generation feature on and I am now investigating it.

#2 Updated by O'Neil Delpratt about 6 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 100

This bug has now been fixed. Major changes have been made to the FilterExpressionCompiler to better handle the predicate.

#3 Updated by O'Neil Delpratt about 6 years ago

  • Status changed from Resolved to Closed
  • Fixed in version set to 9.5.1.6

Bug fix applied in Saxon maintenance release 9.5.1.6

Please register to edit this issue

Also available in: Atom PDF