<div dir="ltr">Make it so. "Dict keeps insertion order" is the ruling. Thanks!<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 15, 2017 at 2:30 AM, INADA Naoki <span dir="ltr"><<a href="mailto:songofacandy@gmail.com" target="_blank">songofacandy@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">> That's interesting information - I wasn't aware of the different<br>
> performance goals.<br>
<br>
</span>FYI, performance characteristic of my POC implementation of<br>
OrderedDict based on dict order are:<br>
<br>
* 50% less memory usage<br>
* 15% faster creation<br>
* 100% (2x) faster iteration<br>
* 20% slower move_to_end<br>
* 40% slower comparison<br>
<br>
(copied from <a href="https://bugs.python.org/issue31265#msg301942" rel="noreferrer" target="_blank">https://bugs.python.org/<wbr>issue31265#msg301942</a> )<br>
<br>
Comparison is very unoptimized at the moment and I believe it can be<br>
more faster.<br>
On the other hand, I'm not sure about I can optimize move_to_end() more.<br>
<br>
If OrderdDict is recommended to be used for just keeping insertion order,<br>
I feel 1/2 memory usage and 2x faster iteration are more important than<br>
20% slower move_to_end().<br>
<br>
But if either "dict keeps insertion order" or "dict keeps insertion order until<br>
deletion" is language spec, there is no reason to use energy and time for<br>
discussion of OrderedDict implementation.<br>
<br>
Regards,<br>
<br>
INADA Naoki  <<a href="mailto:songofacandy@gmail.com">songofacandy@gmail.com</a>><br>
<div class="HOEnZb"><div class="h5">______________________________<wbr>_________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org">Python-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-dev" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/guido%40python.org" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/options/python-dev/<wbr>guido%40python.org</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">--Guido van Rossum (<a href="http://python.org/~guido" target="_blank">python.org/~guido</a>)</div>
</div>