Message301942
> 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. |
|
Date |
User |
Action |
Args |
2017-09-12 07:40:07 | methane | set | recipients:
+ methane, arigo, rhettinger, aronacher, eric.snow, serhiy.storchaka |
2017-09-12 07:40:07 | methane | set | messageid: <1505202007.05.0.194993661316.issue31265@psf.upfronthosting.co.za> |
2017-09-12 07:40:07 | methane | link | issue31265 messages |
2017-09-12 07:40:06 | methane | create | |
|