David Wyde <david.w...@gmail.com> added the comment:

Thanks for the speedy and helpful response.

Keeping complexity down is fair. The wasted if-checks on subsequent iterations 
are certainly a negative trade-off. I saw that binarysort() is only called in 
one place, but I understand wanting to keep it generic.

I think that slow comparison functions, especially when repeatedly sorting 
short lists, are the main use case.

I don't know if that's common in performance-critical code. I've heard of using 
human choices for comparisons, when fewer decisions could provide a notable 
speedup. The patched code seems a bit slower in some situations, but is faster 
in others.

Do you think it's worth posting to python-ideas to see what people's use cases 
are?

----------
Added file: https://bugs.python.org/file47964/sort-fix-2.diff

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue35369>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to