jj2007 wrote:So why is the C runtime sort so slow? Normally, I would expect a quicksort there. My radix sort is still a tick faster, though:
See my citation above from Wikipedia regarding the C implementation. There may also be some overhead involved. A direct FB implementation without lib calls seems like the best choice.
Shellsort performs more operations and has higher cache miss ratio than quicksort. However, since it can be implemented using little code and does not use the call stack, some implementations of the qsort function in the C standard library
Yes, but your timings for the C runtime sort are a factor 10 faster than those for the shellsort. Which means that either your FB implementation of shellsort is very inefficient, or the C runtime sort is not a shellsort.
Just for fun, what about other sizes? This is ArraySort
, under the hood it's still radix sort:
Code: Select all
1.09 secs for sorting 10 Million integer elements
1.43 secs for sorting 10 Million QWORD elements
1.45 secs for sorting 10 Million float elements
1.61 secs for sorting 10 Million double elements
Btw the forum is extremely slow today, is it only my line, or do others experience the same slow responses?