mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Squash a few calls to the hideously expensive PyObject_CallObject(o,a)
-- replace then with slightly faster PyObject_Call(o,a,NULL). (The difference is that the latter requires a to be a tuple; the former allows other values and wraps them in a tuple if necessary; it involves two more levels of C function calls to accomplish all that.)
This commit is contained in:
parent
c13f724af0
commit
84b2bed435
5 changed files with 37 additions and 12 deletions
|
@ -1727,7 +1727,7 @@ PyObject_CallFunction(PyObject *callable, char *format, ...)
|
|||
return NULL;
|
||||
args = a;
|
||||
}
|
||||
retval = PyObject_CallObject(callable, args);
|
||||
retval = PyObject_Call(callable, args, NULL);
|
||||
|
||||
Py_DECREF(args);
|
||||
|
||||
|
@ -1774,7 +1774,7 @@ PyObject_CallMethod(PyObject *o, char *name, char *format, ...)
|
|||
args = a;
|
||||
}
|
||||
|
||||
retval = PyObject_CallObject(func, args);
|
||||
retval = PyObject_Call(func, args, NULL);
|
||||
|
||||
Py_DECREF(args);
|
||||
Py_DECREF(func);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue