The code in this post was a quicksort that used the less than operator for comparison. Here are some times of quicksort using a comparison function the same way the Array.sort works.
The times are quite a bit slower, and I need to dig into it further. These are the means of five runs each on one million values. Some of the cases (triangular, random) had a very large variation between runs.
|||The values in the array are 0, 1, 2, 3, 0, 1, 2, 3, … the whole way to the end of the array.|
|||The value in the array are 0, 1, …, N/2-1, N/2, N/2-1, …, 1,0|