This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author methane
Recipients arigo, aronacher, eric.snow, methane, rhettinger, serhiy.storchaka
Date 2017-09-12.07:40:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1505202007.05.0.194993661316.issue31265@psf.upfronthosting.co.za>
In-reply-to
Content
> I would side with Inada in thinking they both give the same amortized complexity, but beyond that, benchmarks are the real answer.  There is little value in keeping the current implementation of OrderedDict *if* benchmarks show that it is rarely faster.

As I wrote in here:
https://bugs.python.org/issue31265#msg300757

PyPy-like ODict implementation is:

* 1000 less lines of code
* 50% less memory usage
* 15% faster creation
* 100% (2x) faster iteration
* 20% slower move_to_end
* 40% slower comparison

Since current implementation is still draft, there are some
potential optimization.

* Optimize over allocation ratio for move_to_end.  I have not tried to adjust it for nice balance between speed and space.
* I used temporary list to comparing keys safely.  But it can be avoided like normal iteration.

I'll try them in this or next week.
History
Date User Action Args
2017-09-12 07:40:07methanesetrecipients: + methane, arigo, rhettinger, aronacher, eric.snow, serhiy.storchaka
2017-09-12 07:40:07methanesetmessageid: <1505202007.05.0.194993661316.issue31265@psf.upfronthosting.co.za>
2017-09-12 07:40:07methanelinkissue31265 messages
2017-09-12 07:40:06methanecreate