<div dir="auto">Hi Christian,<div dir="auto"><br></div><div dir="auto">The difference between C and Assembly is a lot smaller than between C and XQ, and I think memory management should not be taken lightly (I'm not saying you do). In OP's case, I believe keys could be discarded while memory layout remains intact.</div><div dir="auto"><br></div><div dir="auto">Cheers,</div><div dir="auto">Wouter</div><div class="gmail_extra" dir="auto"><br><div class="gmail_quote">Op 16 jul. 2017 12:52 schreef "Christian Grün" <<a href="mailto:christian.gruen@gmail.com" target="_blank">christian.gruen@gmail.com</a>>:<br type="attribution"><blockquote class="m_-1363029669410754233quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Wouter,<br>
<br>
In my experience, XQuery maps can be surprisingly efficient, even if<br>
millions of items need to be processed. Obviously, no programming<br>
language solves all problems best, though (even today, an assembler<br>
language can a better choice than C).<br>
<br>
Did you come across particular use cases in which it turned out that<br>
XQuery maps and arrays were not the best choice? What do you believe<br>
was the critical factor (memory consumption, runtime, …)?<br>
<br>
Cheers,<br>
Christian<br>
<div class="m_-1363029669410754233elided-text"><br>
<br>
<br>
<br>
On Sun, Jul 16, 2017 at 12:08 PM, W.S. Hager <<a href="mailto:wshager@gmail.com" target="_blank">wshager@gmail.com</a>> wrote:<br>
> Fact of the matter is that if a low level optimization can be made, it must<br>
> be made outside of XQuery. I assume it happens all the time. But sure, it<br>
> depends on the use case.<br>
><br>
> Op 15 jul. 2017 22:47 schreef "Michael Kay" <<a href="mailto:mike@saxonica.com" target="_blank">mike@saxonica.com</a>>:<br>
><br>
>><br>
>> Obviously this operation could be implemented in the host language to make<br>
>> it truly efficient.<br>
><br>
> Don't assume that other languages are inevitably more efficient than XQuery.<br>
><br>
> And don't assume that the cost of moving/converting data from one<br>
> programming language to another is negligible.<br>
><br>
> Michael Kay<br>
> Saxonica<br>
><br>
><br>
</div></blockquote></div><br></div></div>