Stefan Pochmann <stefan.pochm...@gmail.com> added the comment:
Hmm. What do you think about using "<" inside the loop for the remaining tuple elements as well? It's even less likely that both the first and the second elements are equal. When the second elements differ, this saves 0.5 PyObject_RichCompareBool (average 1.5 "<" instead of one "==" and one "<"). When the second elements are equal, this costs 1 PyObject_RichCompareBool more (two "<" instead of one "=="). That's fewer PyObject_RichCompareBool calls if they're equal less than 1/3 of the time. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue45530> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com