Performance: $x[$x[$i]] with bytecode enabled
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
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