That's indeed unusual. Maybe some things are happening in the parsing step that are supposed to happen at evaluation time? Could you possibly run the query with the following call and send us the result?
java -Xrunhprof:cpu=samples,depth=25 -cp BaseX.jar org.basex.Basex -r10 your-query.xq
If you manage to create an SSCCE of the code and data, that would even be better.
Back to your original question: Currently, there is no way to precompile XQuery expressions. However, repeatedly executed queries should be evaluated faster when using the client/server architecture.
Christian
On Mon, Jun 22, 2015 at 3:31 PM, Alexander Shpack shadowkin@gmail.com wrote:
Parsing: 1539.6 ms Compiling: 46.47 ms Evaluating: 115.02 ms Printing: 5.84 ms Total Time: 1706.94 ms
Hit(s): 1 Item Updated: 0 Items Printed: 1927 Bytes Read Locking: local [***, ***] Write Locking: none
Query executed in 1706.94 ms.