Author rhettinger
Recipients pitrou, rhettinger
Date 2008-11-16.15:13:31
SpamBayes Score 1.05721e-08
Marked as misclassified No
Message-id <1226848412.62.0.980605366134.issue3106@psf.upfronthosting.co.za>
In-reply-to
Content
You may get better timings if you more the types-are-equal test inside
the types-i-know test.  Instead of:
+		if (Py_TYPE(v) == Py_TYPE(w)) {
+			if (PyLong_CheckExact(v)) {
+				if (v == w)
+					break;
+				return PyLong_RichCompare(v, w, op);
+			}
+			if (PyUnicode_CheckExact(v)) {

Do something like:
+		if (PyLong_CheckExact(v)) {
+			if (Py_TYPE(v) == Py_TYPE(w)) {
+				if (v == w)
+					break;
+				return PyLong_RichCompare(v, w, op);
+			}
+		if (PyUnicode_CheckExact(v)) {
+			if (Py_TYPE(v) == Py_TYPE(w)) {

In general, I'm not too keen on adding this kind of dispatch code to
ceval.c.  It saves the time spent in PyObject_RichCompare() trying to
figure out where to delegate the work.  But it comes at the expense of
weighing down ALL of the other comparisons which haven't gotten a
short-cut specialization.
History
Date User Action Args
2008-11-16 15:13:32rhettingersetrecipients: + rhettinger, pitrou
2008-11-16 15:13:32rhettingersetmessageid: <1226848412.62.0.980605366134.issue3106@psf.upfronthosting.co.za>
2008-11-16 15:13:32rhettingerlinkissue3106 messages
2008-11-16 15:13:31rhettingercreate