This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author nascheme
Recipients nascheme
Date 2021-08-16.19:03:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1629140628.15.0.283035330269.issue44897@roundup.psfhosted.org>
In-reply-to
Content
Based on some testing, I think an extra type slot is not worth the extra complication.  I made some small improvements to _Py_Dealloc and now the performance seems a bit better.  Basically, I expanded _PyObject_IS_GC() to put the most common branches first.  See pypref-trashcan2.txt for benchmark.  Overall I think might be a bit slower (less than 1%?)  but we have gained trashcan protection for the dealloc of all GC objects.  

If we are okay with the performance, here are other questions to answer:

A) is it safe to untrack GC objects before calling tp_dealloc?

B) is it safe to have PyObject_CallFinalizerFromDealloc() track objects that are resurrected?


We might have to look at 3rd party extensions to decide on those.  I.e. maybe in theory it is not safe but in practice there is no extension code that would actually break.
History
Date User Action Args
2021-08-16 19:03:48naschemesetrecipients: + nascheme
2021-08-16 19:03:48naschemesetmessageid: <1629140628.15.0.283035330269.issue44897@roundup.psfhosted.org>
2021-08-16 19:03:48naschemelinkissue44897 messages
2021-08-16 19:03:48naschemecreate