replace quicksort with insertion sort

N is generally small, so a simple insertion sort is more appropriate,
especially when moved to the point we already have the fates in the cache.