A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2016-September/146424.html below:

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

[Python-Dev] Python 3.6 dict becomes compact and gets a private version; and keywords become ordered [Python-Dev] Python 3.6 dict becomes compact and gets a private version; and keywords become orderedVictor Stinner victor.stinner at gmail.com
Mon Sep 12 08:36:53 EDT 2016
2016-09-12 13:50 GMT+02:00 Antoine Pitrou <solipsis at 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
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4