Skip to content

Commit 3092f32

Browse files
authored
gh-162350: Add AC vectorcall for mappingproxy.__new__ to speed up types.MappingProxyType (#162430)
MappingProxyType AC vectorcall
1 parent 06eb745 commit 3092f32

2 files changed

Lines changed: 39 additions & 5 deletions

File tree

‎Objects/clinic/descrobject.c.h‎

Lines changed: 36 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Objects/descrobject.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1300,6 +1300,7 @@ PyDictProxy_New(PyObject *mapping)
13001300
}
13011301

13021302
/*[clinic input]
1303+
@vectorcall
13031304
@classmethod
13041305
mappingproxy.__new__ as mappingproxy_new
13051306
@@ -1310,7 +1311,7 @@ Read-only proxy of a mapping.
13101311

13111312
static PyObject *
13121313
mappingproxy_new_impl(PyTypeObject *type, PyObject *mapping)
1313-
/*[clinic end generated code: output=65f27f02d5b68fa7 input=c156df096ef7590c]*/
1314+
/*[clinic end generated code: output=65f27f02d5b68fa7 input=7388846480c052d2]*/
13141315
{
13151316
return PyDictProxy_New(mapping);
13161317
}
@@ -2057,6 +2058,7 @@ PyTypeObject PyDictProxy_Type = {
20572058
0, /* tp_init */
20582059
0, /* tp_alloc */
20592060
mappingproxy_new, /* tp_new */
2061+
.tp_vectorcall = mappingproxy_vectorcall,
20602062
};
20612063

20622064
PyTypeObject PyProperty_Type = {

0 commit comments

Comments
 (0)