Timsort is the default sort algo of Python and Java and it performs better than mergesort on roughly sorted lists. I could not find any implementation of this in Elisp. How can I find out whether there is such a thing in Emacs Lisp?
OP EDIT, adding more context:
There is a real situation to this demand. There is literally an I/O of about 30 sec (a question to the final user) in each comparison. And in 80% of the cases the list is already kind-of sorted, where timsort takes big advantage above mergesort. In my case EACH question saved worth too much! If you are curious about the project, look at this: https://github.com/felipelalli/org-sort-tasks
Related issue: https://github.com/felipelalli/org-sort-tasks/issues/3
sort
is written in C code. It may be optimistic to expect better performance out of an elisp sort function, even if the algorithm is superior in the circumstances. – phils May 21 '19 at 4:44