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

Remove lazy dictionary tracking #127010

Closed
markshannon opened this issue Nov 19, 2024 · 1 comment
Closed

Remove lazy dictionary tracking #127010

markshannon opened this issue Nov 19, 2024 · 1 comment
Assignees
Labels
3.14 new features, bugs and security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) performance Performance or resource usage

Comments

@markshannon
Copy link
Member

markshannon commented Nov 19, 2024

Feature or enhancement

Proposal:

In order to reduce the overhead of cycle GC detection for objects that cannot be part of cycles, we lazily untrack tuples and dictionary that only refer to objects that cannot be part of a cycle.

This is fine for tuples, but dictionaries are mutable, so we need to check every time a dictionary is modified whether it needs to be tracked.

Since most objects no longer have a __dict__ dictionary, the complexity and overhead of this lazy tracking is not worth the small benefit in the cycle GC.

This was originally implemented in #126502, but is largely orthogonal to the main purpose of that PR, so should be implemented separately.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Linked PRs

@markshannon markshannon added type-feature A feature request or enhancement performance Performance or resource usage 3.14 new features, bugs and security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) and removed type-feature A feature request or enhancement labels Nov 19, 2024
@markshannon markshannon self-assigned this Nov 19, 2024
@nascheme
Copy link
Member

This sounds like a good idea to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.14 new features, bugs and security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) performance Performance or resource usage
Projects
None yet
Development

No branches or pull requests

2 participants