Defer finalizers and complex dealloc functions to eval-breaker points. #106722
Labels
interpreter-core
(Objects, Python, Grammar, and Parser dirs)
performance
Performance or resource usage
Py_DECREF()
is ubiquitous in the interpreter and in C extensions.This is a problem for optimization, as
Py_DECREF()
can deallocate objects, resulting in potentially arbitrary code execution.Arbitrary code execution means that anything can change, undermining any analysis or assumptions that may have been made by the optimizer.
To allow us to optimize effectively, we want to defer this arbitrary code execution until a known point. We choose the eval-breaker mechanism, as this can already execute arbitrary code.
The challenge is to defer deallocation by as little as possible, and to minimize the performance impact.
faster-cpython/ideas#582
Linked PRs
Py_DECREF
#106685The text was updated successfully, but these errors were encountered: