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).
diff --git a/Objects/listobject.c b/Objects/listobject.c
index dd2d580..4825e9b 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -780,7 +780,7 @@
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;