Skip to content

Commit f541b9c

Browse files
committed
improve performance
1 parent 47070c3 commit f541b9c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/sort/sortperm.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,8 +389,8 @@ function ds_sort_perm(ds, colsidx, by::Vector{<:Function}, rev::Vector{Bool}, a:
389389
last_valid_range = fast_sortperm_int_lm!(_tmp, idx, int_permcpy, ranges, rangelen, minval, _missat == :left, last_valid_range, Val(T))
390390
continue
391391
end
392-
# we should check if there are many observations in each group
393-
if threads && n/last_valid_range > 2.0*rangelen && rangelen*Threads.nthreads() < n/2 # if rangelen is not that much
392+
# we should check if there are many observations in each group/ this version of int sort allocate where for every iteration
393+
if threads && n/last_valid_range > max(2.0*rangelen,10^6) && rangelen*Threads.nthreads() < n/2 # if rangelen is not that much
394394

395395
last_valid_range = fast_sortperm_int_threaded!(_tmp, idx, int_permcpy, ranges, rangelen, minval, _missat == :left, last_valid_range, Val(T))
396396
continue

0 commit comments

Comments
 (0)