improve heapsort trying to accelate speed

change dtype to index