Xiang Zhang added the comment: > I confirmed and investigated it. Thanks! I'll post patch including more test in 24 hours.
Please wait a second. The cause of this problem is that attribute setting causes a combined table to be splitted (the code path is [0]->[1]->[2]->[3]). So every time you set an attribute and then pop, it will do dictresize(right now it will increase memory usage). So even if you make pop() not increase memory usage, the example Min gives will still do much work not wanted (dictresize and make_keys_shared). Actually I think memory usage increasing is not a problem if other things are right. popitem() before does the same thing and should never cause a problem. [0] https://hg.python.org/cpython/file/tip/Python/ceval.c#l2248 [1] https://hg.python.org/cpython/file/tip/Objects/object.c#l1119 [2] https://hg.python.org/cpython/file/tip/Objects/object.c#l1125 [3] https://hg.python.org/cpython/file/tip/Objects/object.c#l1172 ---------- nosy: +xiang.zhang _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue28147> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com