mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
docompare(): Another reasonable optimization from Jonathan Hogg for the
explicit comparison function case: use PyObject_Call instead of PyEval_CallObject. Same thing in context, but gives a 2.4% overall speedup when sorting a list of ints via list.sort(__builtin__.cmp).
This commit is contained in:
parent
155adbdcbb
commit
58cf361e35
2 changed files with 2 additions and 1 deletions
|
@ -213,6 +213,7 @@ Joerg-Cyril Hoehle
|
|||
Gregor Hoffleit
|
||||
Chris Hoffman
|
||||
Albert Hofkamp
|
||||
Jonathan Hogg
|
||||
Gerrit Holl
|
||||
Philip Homburg
|
||||
Naofumi Honda
|
||||
|
|
|
@ -780,7 +780,7 @@ docompare(PyObject *x, PyObject *y, PyObject *compare)
|
|||
Py_INCREF(y);
|
||||
PyTuple_SET_ITEM(args, 0, x);
|
||||
PyTuple_SET_ITEM(args, 1, y);
|
||||
res = PyEval_CallObject(compare, args);
|
||||
res = PyObject_Call(compare, args, NULL);
|
||||
Py_DECREF(args);
|
||||
if (res == NULL)
|
||||
return CMPERROR;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue