[issue25462] Avoid repeated hash calculation in C implementation of OrderedDict

Serhiy Storchaka report at bugs.python.org
Thu Oct 22 14:15:07 EDT 2015


New submission from Serhiy Storchaka:

There are private _PyDict_*_KnownHash functions that allow to avoid repeated hash calculation in complex operations with a dict. Proposed patch makes C implementation of OrderedDict to use these functions. It is not just an optimization, it makes some OrderedDict methods atomic (or almost atomic), that decreases a chance to desynchronize the linked list with the dict. That is why I suggest to commit the patch in 3.5.

----------
components: Regular Expressions
files: odict_knownhash.patch
keywords: patch
messages: 253343
nosy: eric.snow, ezio.melotti, mrabarnett, rhettinger, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Avoid repeated hash calculation in C implementation of OrderedDict
type: enhancement
versions: Python 3.5, Python 3.6
Added file: http://bugs.python.org/file40838/odict_knownhash.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25462>
_______________________________________


More information about the Python-bugs-list mailing list