[Python-Dev] PyDict_SetItem hook
Raymond Hettinger
python at rcn.com
Thu Apr 2 03:37:34 CEST 2009
> John Ehresman wrote:
>> * To what extent should non-debugger code use the hook? At one end of
>> the spectrum, the hook could be made readily available for non-debug use
>> and at the other end, it could be documented as being debug only,
>> disabled in python -O, & not exposed in the stdlib to python code.
>
> To explain Collin's mail:
> Python's dict implementation is crucial to the performance of any Python
> program. Modules, types, instances all rely on the speed of Python's
> dict type because most of them use a dict to store their name space.
> Even the smallest change to the C code may lead to a severe performance
> penalty. This is especially true for set and get operations.
See my comments in http://bugs.python.org/issue5654
Raymond
More information about the Python-Dev
mailing list