Hi,

These are the benchmarking result.

basex -V -r100000 "import module 'http://www.xyz.org/2008/function/ins' at 'file:/C:/avc/FUNCTION_LIBRARY.xq';'a'"
a
Query:
import module 'http://www.xyz.org/2008/function/ins' at 'file:/C:/avc/FUNCTION_LIBRARY.xq';'a'

Parsing: 2.71 ms (avg)
Compiling: 0.0 ms (avg)
Evaluating: 0.0 ms (avg)
Printing: 0.01 ms (avg)
Total Time: 2.73 ms (avg)

Hit(s): 1 Item
Updated: 0 Items
Printed: 1 Byte
Read Locking: none
Write Locking: none

Query executed in 2.73 ms (avg). 

I have one more doubt regarding module compilation. Are the modules compiled lazily ?.


On 23 January 2015 at 17:21, Christian Grün <christian.gruen@gmail.com> wrote:
Hi Ankit,

> In my queries  I am also including a module function library in each of my
> xqueries,
> so is there a way I can directly set the compiled module function library
> for all the QueryProcessor instance ,instead of adding library
> every time instance gets created.

I guess you are using the import module statement of XQuery? That's
the only way to do it (but it will only be parsed once per call).
However, if you copy your module to the repository, you won't have to
specify the file path. I invite you to check out our documentation on
the XQuery repository [1].

Regarding your request of compiling the module, I would be interested
to hear if you have already done some benchmarking in order to find
out how much time is spent for parsing the module?

Best,
Christian

[1] http://docs.basex.org/wiki/Repository


>
>
> Thanks
> Anky
>
> On 23 January 2015 at 16:13, Christian Grün <christian.gruen@gmail.com>
> wrote:
>>
>> Hi Ankit,
>>
>> > I was exploring BaseX for my XML based product. I was wondering whether
>> > there is Prepared Statement Like facility incorporated in BaseX,
>> >
>> > With the same QueryProcessor instance, is it possible to execute it
>> > multiple
>> > times with different binding values for given variable.
>>
>> We are working on caching precompiled XQuery expressions; for now, you
>> need to create new QueryProcessor instances. In practice, however,
>> this rarely leads to problems, because QueryProcessor instances are
>> very light-weight. The following BaseX call creates 100,000 instances
>> of the QueryProcessor, it takes around 2 seconds:
>>
>> > basex -V -r100000 "1"
>>
>> Parsing: 0.01 ms (avg)
>> Compiling: 0.0 ms (avg)
>> Evaluating: 0.0 ms (avg)
>> Printing: 0.01 ms (avg)
>> Total Time: 0.02 ms (avg)
>>
>> Obviously, the query "1" is very simple, but usually, parsing only
>> gets relevant if the queries to be parsed take many KBs or even MBs
>> (such as can be the case in RESTXQ applications).
>>
>> Best,
>> Christian
>
>