-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A take at updating Cryptol's sort function from insertion sort to merge sort #1302
Conversation
…ge sort. This implementation is much more computationally efficient.
I imagine that one of the two definitions of |
Are these sorts still stable? I know that was an important design consideration for the first version. EDIT: some limited testing suggests that these are stable sorts. |
On my machine, I'm seeing that the new sorts take about half the time as the current sort to sort a random |
@robdockins Perhaps you didn't update the recursive calls to
|
Well guessed, that's exactly what I did. Rookie mistake! This seems like a great improvement to me. I guess I have a slight preference for |
Inlining the merge function seems to have sped things up even more. |
Should I update the failing tests by hand, or is there an automated way to do that? |
No automation for that, unfortunately, other than copy/paste the suggested command line. |
@robdockins The CI passes and I don't envision any more work being done. Is there anything else you (or perhaps @brianhuffman) would like to see before considering a merge? |
I'm happy. Any thoughts @brianhuffman ? |
Seems reasonable to me. At some point we should really decide on the complexity of |
Here we provide an implementation for
sort
that is much more computationally efficient than the current one. For example, sorting 3000 Integers takes ~4 seconds where the current implementation takes over a minute.There are two variations on merging two sorted lists to choose from. They seem similar in terms of runtime and time it takes to prove a property.