Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Defer finalizers and complex dealloc functions to eval-breaker points. #106722

Open
markshannon opened this issue Jul 13, 2023 · 0 comments
Open
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) performance Performance or resource usage

Comments

@markshannon
Copy link
Member

markshannon commented Jul 13, 2023

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

@markshannon markshannon added the performance Performance or resource usage label Jul 13, 2023
@iritkatriel iritkatriel added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) performance Performance or resource usage
Projects
None yet
Development

No branches or pull requests

2 participants