[issue35369] List sorting makes duplicate comparisons

2018-12-01 Thread David Wyde
David Wyde added the comment: Okay. Thanks! -- ___ Python tracker <https://bugs.python.org/issue35369> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35369] List sorting makes duplicate comparisons

2018-12-01 Thread David Wyde
David Wyde 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

[issue35369] List sorting makes duplicate comparisons

2018-11-30 Thread David Wyde
Change by David Wyde : Added file: https://bugs.python.org/file47963/sort.py ___ Python tracker <https://bugs.python.org/issue35369> ___ ___ Python-bugs-list mailin

[issue35369] List sorting makes duplicate comparisons

2018-11-30 Thread David Wyde
New submission from David Wyde : Python's Timsort sometimes makes the same comparison twice. This leads to extra compares, which can hurt performance. Python sorts several length-3 permutations in 4 steps, and the problem accumulates with bigger data. There are ~9,800 duplicate less-than