Hi Rob,

I have finally added an issue to support caching for load-xquery-module; we’ll see what we can do [1].

Best,
Christian

[1] https://github.com/BaseXdb/basex/issues/2516


Von: Gunther Rademacher via BaseX-Talk <basex-talk@mailman.uni-konstanz.de>
Gesendet: Montag, 15. September 2025 11:45
An: r.stapper@lijbrandt.nl <r.stapper@lijbrandt.nl>; basex-talk@mailman.uni-konstanz.de <basex-talk@mailman.uni-konstanz.de>
Betreff: [basex-talk] Re: load-xquery-module
 
Hi Rob,

there is currently no caching for modules loaded via load-xquery-module, rather the module source is accessed with each invocation. However as the function is defined as "deterministic", it should guarantee within a single query execution to return the same results for the same parameters. Which it currently can't - thanks for pointing this out. We will take care of this to make sure that a module source is accessed only once per query execution.

The multitude of "location-hints" mirrors the multitude of URILiterals following the "at" keyword of "import module". This is because a module is explicitly allowed to be split across multiple sources. So the behavior of "location-hints" is that of "import module": each source is expected to contain a part of the module.

Best regards
Gunther
Gesendet: Donnerstag, 11. September 2025 um 17:24
Von: "Rob Stapper via BaseX-Talk" <basex-talk@mailman.uni-konstanz.de>
An: "basex-talk@mailman.uni-konstanz.de" <basex-talk@mailman.uni-konstanz.de>
Betreff: [basex-talk] load-xquery-module
Hi Christian,
 
I'm experimenting with dynamic modul loading using: 'load-xquery-module'. I have a few questions concerning this function:
 
- Does this function cache the loaded modul like "import module" does? If I interpret the profiling data correcty, it does not. If so is it possible to also cache dynamicly loaded modules?
 
- "location-hints" of this function accepts a set of locations. It seems that all these locations must contain a module with the given modul-uri. I would expect the one would be sufficient. What is the idea behind this locationset?
 
Thanx in advance for your response.
 
mvgr.
Rob Stapper