Skip to content

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

Merged
markshannon merged 4 commits into
python:mainfrom
faster-cpython:eager-dict-tracking
Nov 20, 2024
Merged

GH-127010: Don't lazily track and untrack dicts#127027
markshannon merged 4 commits into
python:mainfrom
faster-cpython:eager-dict-tracking

Conversation

@markshannon

@markshannon markshannon commented Nov 19, 2024

Copy link
Copy Markdown
Member

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
Copy Markdown

🤖 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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member Author

The windows buildbot failures are unrelated to this PR.

Comment thread InternalDocs/garbage_collector.md Outdated
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
Copy Markdown
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.

Comment thread Objects/dictobject.c
@markshannon

Copy link
Copy Markdown
Member Author

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

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