[Python-Dev] Optimizing list.sort() by checking type in advance (original) (raw)

Tim Peters tim.peters at gmail.com
Tue Oct 11 20:46:54 EDT 2016


[Terry Reedy]

This seems like a generic issue with timing mutation methods ... But I am sure Tim worked this out in his test code, which should be reused, perhaps updated with Viktor's perf module to get the most stable timings possible.

sortperf.py is older than me ;-) It's not at all intended to give fine-grained timings: it's a sledgehammer than runs each case only once, to confirm/refute big changes.

So it's useful qualitatively when a "big claimed change" is at issue, but useless for quantifying beyond "wow!" or "ouch!" or "meh".

Since this is a "big claimed change", a "wow!" outcome is good-enough confirmation. And a "meh" outcome would be almost good enough for cases where the new specializations don't apply - although I haven't seen any numbers from sortperf.py for those cases yet. I expect a "meh" outcome for those, based on reasoning - but may be surprised by reality.



More information about the Python-Dev mailing list