Skip to content

gh-141510: Update specializer to support frozendict with BINARY_SUBSCR#144911

Closed
corona10 wants to merge 13 commits intopython:mainfrom
corona10:gh-141510-specializer
Closed

gh-141510: Update specializer to support frozendict with BINARY_SUBSCR#144911
corona10 wants to merge 13 commits intopython:mainfrom
corona10:gh-141510-specializer

Conversation

@corona10
Copy link
Member

@corona10 corona10 commented Feb 17, 2026

We need to register frozendict for support in the specializer.

Since frozendict is only introduced in Python 3.15, it is not yet widely used. However, it is thread safe for many operations, including CALL_LEN and BINARY_OP_SUBSCR. It could also be optimized more aggressively in the JIT using KNOWN_CLASS optimizations in the pipeline.

This is just part of a draft PR. I am also happy to make _BINARY_OP_SUBSCR_FROZEN_DICT part of _BINARY_OP_SUBSCR_DICT, depending on what the JIT team prefers.

Without this PR, frozendict would be at a performance disadvantage, even though it is intended to be a first-class citizen alongside dict.

Loading
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.

5 participants