Skip to content

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

@markshannon

Description

@markshannon

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usage

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions