Hello all,
I wrote some basic debugging / profiling tools for xquery code, using try{} catch *{} mechanisms. However, profiling tools are not reliable.
The suspected reason is that inlining is not activated in try catch expression. If confirmed, is it a desired behavior ?
Here is the basic test :
declare function local:test($i){fn:for-each(1 to $i, function($a){2*$a})}; declare function local:fun-profile($fun,$args) {try{local:call($fun,$args)} catch *{()}}; declare function local:fun-profile2($fun,$args) {local:call($fun,$args)};
With default options (ie inlining activated)
prof:time(count(local:fun-profile2(local:test#1, 10000000))) Output : 683.12 ms prof:time(count(local:fun-profile(local:test#1, 10000000))) Output : 2465.47 ms
With inlining desactivated (ie INLINELIMIT=0) prof:time(count(local:fun-profile2(local:test#1, 10000000))) Output : 2480.32 ms