Uh oh!
There was an error while loading. Please reload this page.
gh-100239: specialize dict subclasses with no getitem override - #132383
gh-100239: specialize dict subclasses with no getitem override#132383iritkatriel wants to merge 6 commits into
Conversation
iritkatriel
commented
Apr 11, 2025
The tests will be great again once we merge the fix for #132284. |
| PyObject *dict = PyStackRef_AsPyObjectBorrow(dict_st); | ||
| assert(PyDict_CheckExact(dict)); | ||
| assert(PyDict_Check(dict)); |
There was a problem hiding this comment.
I think you also need to change _GUARD_NOS_DICT to PyDict_Check instead of PyDict_CheckExact for this to work but I am not sure.
iritkatriel
commented
Apr 12, 2025
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 |
markshannon
left a comment
There was a problem hiding this comment.
Is it worth making dict_subscript non-static to avoid the indirection PyDict_Type.tp_as_mapping->mp_subscript?
Uh oh!
There was an error while loading. Please reload this page.
markshannon
left a comment
There was a problem hiding this comment.
It looks like the test_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.
This PR is stale because it has been open for 30 days with no activity. |
kumaraditya303
commented
May 29, 2026
Superseded by #148128 |

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