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

GH-127010: Don't lazily track and untrack dicts #127027

Merged
merged 4 commits into from
Nov 20, 2024

Conversation

markshannon
Copy link
Member

@markshannon markshannon commented Nov 19, 2024

Remove the code to lazily track and untrack dictionaries.

Benchmarks show a ~1% speedup.


📚 Documentation preview 📚: https://cpython-previews--127027.org.readthedocs.build/

@markshannon markshannon added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Nov 19, 2024
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @markshannon for commit 3c11dba 🤖

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Nov 19, 2024
@@ -581,8 +575,6 @@ tracking status of the object.
>>> gc.is_tracked({})
False
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is empty dict still untracked?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it is tracked. I'll update the docs.

@markshannon
Copy link
Member Author

The windows buildbot failures are unrelated to this PR.

collector footprint of simple instances. Some examples of native types that
benefit from delayed tracking:
collector footprint of simple instances. Historically, both dictionaries and
tuples were untracked during garbage collection. Now it is only tuples:

- Tuples containing only immutable objects (integers, strings etc,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now a single-item bullet list.

Objects/dictobject.c Show resolved Hide resolved
@markshannon
Copy link
Member Author

The aarch64-unknown-linux-gnu/gcc (Debug) failures seem unrelated to this PR (probably timeout related) and there are no leaks.

@markshannon markshannon merged commit aea0c58 into python:main Nov 20, 2024
58 of 59 checks passed
@markshannon markshannon deleted the eager-dict-tracking branch January 10, 2025 16:23
ebonnal pushed a commit to ebonnal/cpython that referenced this pull request Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants