qtspecs icon indicating copy to clipboard operation
qtspecs copied to clipboard

Stability of collections

Open michaelhkay opened this issue 2 years ago • 4 comments

The specification for fn:collection says:

By default, this function is [·deterministic·]. This means that repeated calls on the function with the same argument will return the same result. However, for performance reasons, implementations may provide a user option to evaluate the function without a guarantee of determinism. The manner in which any such option is provided is [·implementation-defined·]. If the user has not selected such an option, a call to this function must either return a deterministic result or must raise a dynamic error [[err:FODC0003].

I think this is unrealistic. The cost of making fn:collection deterministic is disproportionate to the benefits. It's very rare in practice for a query or stylesheet to process the same collection more than once, and retaining the information needed to deliver the identical results on these rare occasions is expensive (typically it means holding a long-term lock on the data, or keeping a copy of the entire collection in memory). It also inhibits techniques such as multi-threaded evaluation.

I would like to relax this requirement.

michaelhkay avatar Dec 08 '22 11:12 michaelhkay