Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.3k
gh-100239: specialize dict subclasses with no getitem override#132383
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
The tests will be great again once we merge the fix for#132284. |
Python/bytecodes.c Outdated
| PyObject*dict=PyStackRef_AsPyObjectBorrow(dict_st); | ||
| assert(PyDict_CheckExact(dict)); | ||
| assert(PyDict_Check(dict)); |
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 think you also need to change_GUARD_NOS_DICT toPyDict_Check instead ofPyDict_CheckExact for this to work but I am not sure.
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.
Perf with the fix to the guard:https://github.com/faster-cpython/benchmarking-public/blob/main/results/bm-20250412-3.14.0a7%2B-3d9cf36/README.md |
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.
Is it worth makingdict_subscript non-static to avoid the indirectionPyDict_Type.tp_as_mapping->mp_subscript?
Uh oh!
There was an error while loading.Please reload this page.
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.
It looks like thetest_opcode test needs updating.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.

Uh oh!
There was an error while loading.Please reload this page.
Perf stats show the specialisation numbers improve, but perf is overall the same.
https://github.com/faster-cpython/benchmarking-public/blob/main/results/bm-20250410-3.14.0a6%2B-bf2d1dd/README.md