gaia sort algorithm performance optimize.