mirror of https://github.com/python/cpython
GH-95977: Speed up calling pure python descriptor __get__ with vectorcall (gh-95978)
This commit is contained in:
parent
c26500224f
commit
f2afdf3352
|
@ -0,0 +1 @@
|
||||||
|
Optimized calling :meth:`~object.__get__` with vectorcall. Patch by Kumar Aditya.
|
|
@ -8242,7 +8242,8 @@ slot_tp_descr_get(PyObject *self, PyObject *obj, PyObject *type)
|
||||||
obj = Py_None;
|
obj = Py_None;
|
||||||
if (type == NULL)
|
if (type == NULL)
|
||||||
type = Py_None;
|
type = Py_None;
|
||||||
return PyObject_CallFunctionObjArgs(get, self, obj, type, NULL);
|
PyObject *stack[3] = {self, obj, type};
|
||||||
|
return PyObject_Vectorcall(get, stack, 3, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
Loading…
Reference in New Issue