2016-09-12 13:50 GMT+02:00 Antoine Pitrou <solip...@pitrou.net>: > Besides, I don't think it has been proven that the compact-and-ordered > dict implementation is actually *faster* than the legacy one.
Python 3.6 dict is slower than Python 3.5 dict, at least for a simple lookup: http://bugs.python.org/issue27350#msg275581 But its memory usage is 25% smaller. I'm curious about the performance of the "compaction" needed after adding too many dummy entries (and to preserve insertion order), but I don't know how to benchmark this :-) Maybe add/remove many new keys? I expect bad performance on the compaction, but maybe not as bad as the "hash DoS". For regular Python code, I don't expect compaction to be a common operation, since it's rare to remove attributes. It's more common to modify attributes value, than to remove them and later add new attributes. Victor _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com