Re: [Python-Dev] Python 3.6 dict becomes compact and gets a private version; and keywords become ordered

2016年9月12日 05:40:04 -0700

2016年09月12日 13:50 GMT+02:00 Antoine Pitrou <[email protected]>:
> 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
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to