GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-143732: allow dict subclasses to be specialized by kumaraditya303 · Pull Request #148128 · python/cpython

Conversation

@kumaraditya303

@kumaraditya303 kumaraditya303 commented Apr 5, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor
  • Issue: Broader specialization in the Specializing Adaptive Interpreter for better JIT performance #143732

This is revival of #132383 which allowed specialization for dict subclasses which do not override __getitem__. This PR also allows specialization for dict subclasses which do not override __setitem__.

This is primarily targeted for defaultdict which is the most performance critical subclass of dict.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
kumaraditya303 added 2 commits April 5, 2026 21:28
@kumaraditya303
wip
78be7d2
@kumaraditya303
Merge branch 'main' of https://github.com/python/cpython into jit-dic…
86aac31
…t-opt
@bedevere-app bedevere-app Bot mentioned this pull request Apr 5, 2026
Broader specialization in the Specializing Adaptive Interpreter for better JIT performance #143732
Open
@kumaraditya303
fix tests
2fdf76f
@kumaraditya303 kumaraditya303 added the skip news label Apr 5, 2026
kumaraditya303 added 2 commits April 5, 2026 21:47
@kumaraditya303
improve tests
0dad4a0
@kumaraditya303
fix test
c953a69
@kumaraditya303
kumaraditya303 marked this pull request as ready for review April 5, 2026 18:39
@kumaraditya303
kumaraditya303 requested review from Fidget-Spinner, markshannon, methane, savannahostrowski and tomasr8 as code owners April 5, 2026 18:39
@bedevere-app bedevere-app Bot added the awaiting core review label Apr 5, 2026
@kumaraditya303 kumaraditya303 added the performance Performance or resource usage label Apr 5, 2026
kumaraditya303 added 5 commits April 7, 2026 18:39
@kumaraditya303
Merge branch 'main' into jit-dict-opt
959bdfa
@kumaraditya303
fix _BINARY_OP_SUBSCR_DICT_KNOWN_HASH
38cd1d3
@kumaraditya303
add more tests
e38a5d3
@kumaraditya303
Merge branch 'jit-dict-opt' of https://github.com/kumaraditya303/cpython
1c6b354
 into jit-dict-opt
@kumaraditya303
add type assertions
6feb117
@kumaraditya303

kumaraditya303 commented Apr 29, 2026

Copy link
Copy Markdown
Contributor Author

@markshannon Can you take a look at this? I'd like get this in time for the beta release.

markshannon reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

markshannon
markshannon reviewed Apr 30, 2026
View reviewed changes

@markshannon markshannon left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Looks good overall.
The old uops need to be removed and some assertions may no longer be valid.

Also, take care with recorded types. Only strengthen type information on proven or guards, not recorded information.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Python/bytecodes.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Python/bytecodes.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Python/bytecodes.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Python/optimizer_bytecodes.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Python/optimizer_bytecodes.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Python/bytecodes.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Python/bytecodes.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Python/bytecodes.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

@markshannon

markshannon commented Apr 30, 2026

Copy link
Copy Markdown
Member

GitHub doen't put comments in order, it seems. The "above" in the comments refers to earlier lines, not earlier comments.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

kumaraditya303 added 6 commits April 30, 2026 17:58
@kumaraditya303
address review
3e88c41
@kumaraditya303
Merge branch 'main' of https://github.com/python/cpython into jit-dic…
af3dbab
…t-opt
@kumaraditya303
fix conflict
61bb5ba
@kumaraditya303
reduce diff
f7e97bd
@kumaraditya303
fix test
f2dc858
@kumaraditya303
fix formatting
17fb6b8
@kumaraditya303
kumaraditya303 requested a review from markshannon April 30, 2026 13:13
@kumaraditya303

kumaraditya303 commented Apr 30, 2026

Copy link
Copy Markdown
Contributor Author

I still think the assert(PyDict_Check(dict)); asserts should be removed.

I removed the assertions now and added watchers for all cases.

I have made the requested changes; please review again

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot added awaiting change review and removed awaiting changes labels Apr 30, 2026
@bedevere-app

bedevere-app Bot commented Apr 30, 2026

Copy link
Copy Markdown

Thanks for making the requested changes!

@markshannon: please review the changes made to this pull request.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app
bedevere-app Bot requested a review from markshannon April 30, 2026 17:44
@read-the-docs-community

read-the-docs-community Bot commented Apr 30, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #32488413 | 📁 Comparing b40e922 against main (b413bc7)

  🔍 Preview build  

12 files changed · ± 12 modified

± Modified

  • contents.html
  • download.html
  • genindex-D.html
  • genindex-H.html
  • genindex-Symbols.html
  • genindex-all.html
  • library/faulthandler.html
  • library/functools.html
  • library/http.server.html
  • library/tomllib.html
  • and 2 more...
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kumaraditya303
remove more leftover assertions
b40e922
markshannon
markshannon requested changes May 1, 2026
View reviewed changes

@markshannon markshannon left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I still think we need more watchers. Sorry, I should have spotted that in the last review.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Python/optimizer_bytecodes.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot added awaiting changes and removed awaiting change review labels May 1, 2026
@bedevere-app

bedevere-app Bot commented May 1, 2026

Copy link
Copy Markdown

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

And if you don't make the requested changes, you will be poked with soft cushions!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

kumaraditya303 added 2 commits May 1, 2026 17:10
@kumaraditya303
add watchers in all cases
3387bff
@kumaraditya303
Merge branch 'main' of https://github.com/python/cpython into jit-dic…
94a7cbb
…t-opt
@kumaraditya303
kumaraditya303 requested a review from markshannon May 1, 2026 11:42
@kumaraditya303

kumaraditya303 commented May 1, 2026

Copy link
Copy Markdown
Contributor Author

Looks like the CI is affected by the Ubuntu outage today.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

kumaraditya303 added 3 commits May 1, 2026 21:22
@kumaraditya303
Merge branch 'main' into jit-dict-opt
f116f96
@kumaraditya303
Merge branch 'main' of https://github.com/python/cpython into jit-dic…
d6b9e26
…t-opt
@kumaraditya303
Merge branch 'jit-dict-opt' of https://github.com/kumaraditya303/cpython
686d630
 into jit-dict-opt
@kumaraditya303

kumaraditya303 commented May 3, 2026

Copy link
Copy Markdown
Contributor Author

I have made the requested changes; please review again

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot added awaiting change review and removed awaiting changes labels May 3, 2026
@bedevere-app

bedevere-app Bot commented May 3, 2026

Copy link
Copy Markdown

Thanks for making the requested changes!

@markshannon: please review the changes made to this pull request.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

markshannon
markshannon approved these changes May 4, 2026
View reviewed changes

@markshannon markshannon left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

This looks good now. Thanks.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting change review labels May 4, 2026
@markshannon
markshannon merged commit 5847931 into python:main May 4, 2026
79 of 82 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting merge label May 4, 2026
@bedevere-bot

bedevere-bot commented May 4, 2026

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 Debian root 3.x (tier-1) has failed when building commit 5847931.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/345/builds/14120) and take a look at the build logs.
  4. Check if the failure is related to this commit (5847931) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/345/builds/14120

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/support/__init__.py", line 948, in gc_collect
    gc.collect()
    ~~~~~~~~~~^^
ResourceWarning: unclosed file <_io.FileIO name=11 mode='wb' closefd=True>
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kumaraditya303
kumaraditya303 deleted the jit-dict-opt branch May 4, 2026 09:08
@kumaraditya303 kumaraditya303 mentioned this pull request May 29, 2026
gh-100239: specialize dict subclasses with no getitem override #132383
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@markshannon markshannon markshannon approved these changes
@tomasr8 tomasr8 Awaiting requested review from tomasr8 tomasr8 is a code owner
@Fidget-Spinner Fidget-Spinner Awaiting requested review from Fidget-Spinner Fidget-Spinner is a code owner
@savannahostrowski savannahostrowski Awaiting requested review from savannahostrowski
@methane methane Awaiting requested review from methane methane is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

performance Performance or resource usage skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@kumaraditya303 @markshannon @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.