Closed
Description
I don't know exactly why sortperm!
allocates here, but I know that it shouldn't:
julia> v = rand(10);
julia> ix = similar(eachindex(v));
julia> @btime sortperm!($ix, $v) setup=(copyto!($ix, eachindex($v))) evals=1;
939.000 ns (5 allocations: 336 bytes)
julia> @btime sort!($ix) setup=(sortperm!($ix, $v)) evals=1;
84.000 ns (0 allocations: 0 bytes)
This is not new in 1.9 but it is slightly worse.