Closed CovetingEpiphany2152 closed 4 years ago
Yeah, I planned to change it here too. I just haven't had the time to take care of it yet (I'm running the tests and benchmarks to check whether they can find any difference).
Thanks. I would expect more insertion sorts being done to hit the minRunLength that is now usually longer (for cases with short runs like random data). As such, worst and random cases should have improvements. Not sure how significant it would be though.
My benchmarks didn't show much improvement. I wouldn't be surprised if it made the a bit slower because most of the library has a limit around 32 for insertion sort which came from benchmarking, but the benchmarks almost exclusively use scalar types, which is not representative of the Python-specific tradeoffs timsort was originally designed for.
https://github.com/Morwenn/cpp-sort/blob/32b874fb025a6e8f86f1db568cd38682cb9f62d9/include/cpp-sort/detail/timsort.h#L192
This line has the same issue as reported in your Timsort repo here.