xiaodaigh / SortingLab.jl

Faster sorting algorithms (sort and sortperm) for Julia
Other
23 stars 4 forks source link

Insertion Sort to Finish Off Radix Sort? #17

Open ParadaCarleton opened 3 years ago

ParadaCarleton commented 3 years ago

For small arrays, insertion sort is more efficient, so handing off a mostly-sorted array to an insertion sort should give speedups. From what I can see, this isn't implemented yet (although I might have missed it).

xiaodaigh commented 3 years ago

No it isn't. I think for smaller arrays, like size 12. That is implemented in base, so not that hard to copy the code over

ParadaCarleton commented 3 years ago

No it isn't. I think for smaller arrays, like size 12. That is implemented in base, so not that hard to copy the code over

I don't think it even needs to be copied, you could just hand off to the base sort!() function.

I think an array size of 32 or 16 is more likely to be optimal, but this should probably be benchmarked.

xiaodaigh commented 3 years ago

I think an array size of 32 or 16 is more likely to be optimal, but this should probably be benchmarked.

The size just copies from base is fine