[New-bugs-announce] [issue29202] Improve dict iteration

Raymond Hettinger report at bugs.python.org
Sun Jan 8 04:50:36 EST 2017


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 <report at bugs.python.org>
<http://bugs.python.org/issue29202>
_______________________________________


More information about the New-bugs-announce mailing list