On 3 Dec 2013, at 09:49, jean-marc Mercier <[email protected]> wrote:

> >Saxon tries quite hard to achieve incremental sequence construction with 
> >linear time 
> > complexity, but it does depend on your using coding patterns that the 
> > optimizer recognizes.
> 
> I was wondering why there is no container for vectors or doubly linked lists 
> shipped with XQUERY ? It sounds strange to me, because there exists a W3C 
> recommendation of maps, as well as interpreters implementing them. Maps (even 
> immutable ones like Phil's Bagwell) are indeed implemented using stacks as 
> far as I know.
> 

I'm not sure you can do anything useful with a doubly-linked list in a language 
where values are immutable.

There might well be scope for pragmas to suggest how particular data (e.g. 
variables) should be optimized for efficiency, but XQuery comes from the world 
of database query languages where the theory is that optimization is the job of 
the system, not the of the programmer.

This does have the effect that performance characteristics can vary widely 
across implementations, for example subscripting $seq[N] takes linear time in 
some implementations and constant time in others.

Michael Kay
Saxonica
_______________________________________________
[email protected]
http://x-query.com/mailman/listinfo/talk

Reply via email to