Skip to content

gh-144140: Optimize len for frozen dict/set constants in optimizer#149969

Open
lgeiger wants to merge 1 commit into
python:mainfrom
lgeiger:frozen-set-dict-len
Open

gh-144140: Optimize len for frozen dict/set constants in optimizer#149969
lgeiger wants to merge 1 commit into
python:mainfrom
lgeiger:frozen-set-dict-len

Conversation

@lgeiger
Copy link
Copy Markdown
Contributor

@lgeiger lgeiger commented May 18, 2026

This PR extends #144142 to also handle frozenset and frozendict. Let me know if you think this optimization is not worth it, but it doesn't complicated the code so I don't see any downsides in adding it.

"PyStackRef_RefcountOnObject",
"PyStackRef_TYPE",
"PyStackRef_True",
"PyBytes_GET_SIZE",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

As far as I can tell #144142 missed adding PyBytes_GET_SIZE to NON_ESCAPING_FUNCTIONS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant