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.
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].
Hope this helps, Christian
[1] http://docs.basex.org/wiki/XQuery_Update#Pending_Update_List