On 22/02/2015 19:50, Christian GrĂ¼n wrote:
Hi Marco,
db:add or db:replace (BTW does this make a difference from a performance point of view?????).
It's faster to add documents, as this operation won't check if a document already exists. In future versions of BaseX, however, we will possibly merge these two functions.
Good to know.
The time T output by the profile:time is a steady amount of time. This means that queries and update schedule is working in constant time. The time reported by Jetty (and perceived at the client) is a T + d. The issue is that this d may vary from something around few hundreds of milliseconds to something which is 4 or 5 times T itself.
Please note that it's not possible to measure the time spent for updating the documents, as this happens at the end of the query execution. In other words, the function call prof:time(delete node <a/>) will only measure how long it takes to add the delete operation to the pending update list [1].
Yes, this was clear to me. I'd like just to understand to what relates the huge difference (d) between "querying the db and scheduling an update to the PUL" which is what the internal function does and the time logged by the basexhttp server as the completion time of the whole RestXQ call which is T + d. Mostly these RestXQs return 1 small XML document or in most cases even nothing at all so it should not be related to the communication between basexserver and basexhttpserver. My guess was that it could be related to the commit of the PUL but I don't know if the PUL is committed after the query is performed or after the RestXQ is completed ... Any insight could be useful. In the meanwhile I'll have a look at the code you pointed me to for the other mail Thanks, Marco.
Hope this helps, Christian
[1] http://docs.basex.org/wiki/XQuery_Update#Pending_Update_List