Project

Profile

Help

Bug #2077

closed

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

Added by Michael Kay almost 10 years ago. Updated over 9 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:
Platforms:

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.

Please register to edit this issue

Also available in: Atom PDF