[1] http://radiospiel.org/sorting-in-c-3-times-faster-than-c
PostgreSQL should really be using a radix sort for these data types, not a quick sort (however "optimized").