New submission from Raymond Hettinger: I haven't had much of a chance to comb through all the code it detail, but there are least a few places that loop over the whole entry table (size is dk_nentries) when fewer iterations would suffice (stop once mp->ma_used entries have been seen). Since the table is usually dense packed to the left, this will give fewer loops and fewer memory accesses.
---------- assignee: serhiy.storchaka components: Interpreter Core files: dict_shorter_iteration.diff keywords: patch messages: 284970 nosy: inada.naoki, rhettinger, serhiy.storchaka priority: normal severity: normal status: open title: Improve dict iteration type: performance versions: Python 3.6, Python 3.7 Added file: http://bugs.python.org/file46209/dict_shorter_iteration.diff _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29202> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com