[issue23132] Faster total_ordering

Nick Coghlan report at bugs.python.org
Wed Dec 31 07:39:45 CET 2014


Nick Coghlan added the comment:

I tweaked Serhiy's benchmark script to also include the timing relative to spelling out all four ordered comparison methods.

For an unpatched debug build of trunk, I get the following:

$ ../py3k/python total_ordering_relative_bench.py 
a < b   1.643 1.605 x0.98
b < a   1.611 1.611 x1.00
a >= b  1.599 3.539 x2.21
b >= a  1.607 3.579 x2.23
a <= b  1.600 3.677 x2.30
b <= a  1.601 5.599 x3.50
a > b   1.600 3.624 x2.26
b > a   1.612 6.465 x4.01

With Serhiy's change applied I get:

$ ../py3k/python total_ordering_relative_bench.py 
a < b   1.599 1.602 x1.00
b < a   1.607 1.609 x1.00
a >= b  1.602 2.802 x1.75
b >= a  1.605 2.804 x1.75
a <= b  1.737 2.842 x1.64
b <= a  1.607 4.835 x3.01
a > b   1.667 2.821 x1.69
b > a   1.597 5.557 x3.48

----------
Added file: http://bugs.python.org/file37569/total_ordering_relative_bench.py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23132>
_______________________________________


More information about the Python-bugs-list mailing list