return [keys[0]] * n def make_temp_array(keys, n): return np.empty(n, keys.dtype) py_list_timsort = make_py_timsort(make_temp_list) py_array_timsort = make_py_timsort(make_temp_array) jit_list_timsort = make_jit_timsort(make_temp_list) jit_array_timsort = make_jit_timsort(make_temp_array) py_quicksort = make_py_quicksort() jit_quicksort = make_jit_quicksort() def sort_usecase(val): val.sort() def argsort_usecase(val): return val.argsort() def argsort_kind_usecase(val, is_stable=False): if is_stable: return val.argsort(kind='mergesort')
def make_temp_list(keys, n): return [keys[0]] * n def make_temp_array(keys, n): return np.empty(n, keys.dtype) py_list_timsort = make_py_timsort(make_temp_list) py_array_timsort = make_py_timsort(make_temp_array) jit_list_timsort = make_jit_timsort(make_temp_list) jit_array_timsort = make_jit_timsort(make_temp_array) py_quicksort = make_py_quicksort() jit_quicksort = make_jit_quicksort() def sort_usecase(val): val.sort() def argsort_usecase(val): return val.argsort() def argsort_kind_usecase(val, is_stable=False): if is_stable: return val.argsort(kind='mergesort') else: return val.argsort(kind='quicksort')