Hello,
I am encountering a performance issue with BaseX interpreter, illustrated by the snippet code above. This code first creates a sequence of 100000 integers, taking more than a minute with my environment. Then it creates a BaseX map of 100000 integers, taking 0.1 sec. This issue seems to be due to a poor performance of the operator () (see function local:id below).
This could be an issue for the BaseX interpreter, or a problem with my environment, but might be also a XQUERY 3.0 "leak". Have you any idea ?
cheers
Jean-Marc
declare function local:id($el) as function() as item()* {function(){ $el }}; declare function local:new() {local:id(())}; declare function local:new($map,$item) {local:id(($map(),$item))};
let $nb := 100000 return let $testid := fn:fold-left(for $i in 1 to $nb return $i,local:new(), function($map,$entry){local:new( $map,$entry )}) let $basexmap := fn:fold-left(for $i in 1 to $nb return map:entry($i,$i),map:entry(0,0), function($entry,$map){map:new( ($map,$entry) )}) return (fn:count(prof:time( $testid )),fn:count(prof:time( $basexmap )))