[Python-Dev] No longer enable Py_TRACE_REFS by default in debug build

Steve Dower steve.dower at python.org
Wed Apr 10 14:45:51 EDT 2019


On 10Apr2019 1109, Steve Dower wrote:
> On 10Apr2019 0401, Victor Stinner wrote:
>>> I think it's worthwhile if we can really get to debug and non-debug
>>> builds being ABI compatible. Getting partway there in this case doesn't
>>> seem to offer any benefits.
>>
>> Disabling Py_TRACE_REFS by default in debug mode reduces the Python
>> memory footprint. Py_TRACE_REFS costs 2 pointers per PyObject: 16
>> bytes on 64-bit platforms.
> 
> Right, except it's debug mode.

I left this comment unfinished :)

It's debug mode, and so you should expect less efficient memory and CPU 
usage. That's why we have two modes - so that it's easier to debug issues.

Now, if debug mode was unusably slow or had way too much overhead, we'd 
want to fix that. But it isn't unusable, so reducing memory usage at the 
cost of making debugging harder is not compelling.

Cheers,
Steve


More information about the Python-Dev mailing list