julia
86b91f00 - nans2left!, nans2right!: be stable on both halves – NaNs and non-NaNs.

Commit
11 years ago
nans2left!, nans2right!: be stable on both halves – NaNs and non-NaNs. Previously, while this was leaving NaNs in order, as is necessary for the algorithm to work correctly, but was always moving the first non- NaN value to the opposite end of the array. This is *very* bad for the median-of-three quicksort pivot selection algorithm when applied to a pre-sorted array since the first and last elements will both end up being very small, effectively always picking a pessimal pivot. This is the root cause of the O(n^2) regression that @illericus was seeing.
Committer
Parents
Loading