You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using SortingNetworks: swapsort
using StaticArrays
for N in5:10@show N
@btimesort($v) setup=(v =SVector{$N}(rand($N)))
println("swapsort")
@btimeswapsort($v) setup=(v =SVector{$N}(rand($N)))
end
since swapsort uses < to sort, you should make the comparison fair:
julia>for N in5:10@show N
@btimesort(v; lt =<) setup=(v =SVector{$N}(rand($N)))
println("swapsort")
@btimeswapsort(v) setup=(v =SVector{$N}(rand($N)))
end
so, yes there is a small difference but the the Bitonic sorting network implementation in StaticArrays is general as opposed to the hard-coded minimal ones in SortingNetworks and allow for potential SIMD use in the future, see #952
Thanks a lot for pointing this out. For my understanding, the slowdown we see in my benchmark is the price we pay for being able to sort arrays that can contain NaN. Is that correct or is there another difference in semantics?
The text was updated successfully, but these errors were encountered: