Hi Erdal,
parsing and compilation phase is pretty fast in BaseX. Before you think about precompiling your queries, it would be interesting to know if parsing and compilation is a real bottleneck.. Have you already done some profiling?
The following example of running a (very simple) query 100'000 times demonstrates that there may be no need to cache queries that are to be executed multiple times:
basex -V -r100000 "1+2"
Parsing: 0.04 ms (avg) Compiling: 0.01 ms (avg) Evaluating: 0.0 ms (avg) Printing: 0.03 ms (avg) Total Time: 0.08 ms (avg)
In a complex query with lots of modules being imported, however, the time for parsing and compiling a query may increase. For those cases, we indeed have some plans to precompile queries in the background. I can’t give you a timeframe yet.
Christian ___________________________
2013/10/22 Erdal Karaca erdal.karaca.de@gmail.com:
Hi all, We have lots of non dynamic (i.e. do not change at run-time) queries/expressions that are always parsed/compiled using a new QueryProcessor instance.
How to cache compiled expressions for use with QueryProcessor? Or can we just cache QueryProcessor instances? If yes, are QueryProcessor instances thread-safe?
Thanks!
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk