Hi Jean-Marc,
the InfoView will give you some hints what’s going on. The reason is
> 1) The following code
> declare function local:sequence($nb){for $i in 1 to xs:integer($nb) return
> $i};
> prof:time(fn:count(local:sequence(1000000000000000000)))
> return 4.94 ms.
that your code is compiled and simplified to the following query..
prof:time(fn:count((1 to 1000000000000000000)))
...which can then be evaluated in constant time.
Currently no. You can use the prof:current-ns() function instead:
> 2) It seems that you somehow call the fn:trace function in the profile
> module. Is there a way to catch the returned values of these functions?
let $start := prof:current-ns()
let $void := prof:void((1 to 10000000)[. = 1])
let $end := prof:current-ns()
let $ms := ($end - $start) div 1000000
return $ms || ' ms'
Hope this helps,
Christian