Message399669
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. |
|
Date |
User |
Action |
Args |
2021-08-16 19:03:48 | nascheme | set | recipients:
+ nascheme |
2021-08-16 19:03:48 | nascheme | set | messageid: <1629140628.15.0.283035330269.issue44897@roundup.psfhosted.org> |
2021-08-16 19:03:48 | nascheme | link | issue44897 messages |
2021-08-16 19:03:48 | nascheme | create | |
|