[Python-checkins] python/dist/src/Objects listobject.c,2.116,2.117

tim_one@users.sourceforge.net tim_one@users.sourceforge.net
Sun, 14 Jul 2002 22:16:15 -0700


Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv2860/Objects

Modified Files:
	listobject.c 
Log Message:
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).


Index: listobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/listobject.c,v
retrieving revision 2.116
retrieving revision 2.117
diff -C2 -d -r2.116 -r2.117
*** listobject.c	13 Jul 2002 03:51:17 -0000	2.116
--- listobject.c	15 Jul 2002 05:16:13 -0000	2.117
***************
*** 781,785 ****
  	PyTuple_SET_ITEM(args, 0, x);
  	PyTuple_SET_ITEM(args, 1, y);
! 	res = PyEval_CallObject(compare, args);
  	Py_DECREF(args);
  	if (res == NULL)
--- 781,785 ----
  	PyTuple_SET_ITEM(args, 0, x);
  	PyTuple_SET_ITEM(args, 1, y);
! 	res = PyObject_Call(compare, args, NULL);
  	Py_DECREF(args);
  	if (res == NULL)