-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Put back the old QuickSort and PartialQuickSort algorithms #47788
Conversation
…s... ...as they were in 1.8 and rename the new PartialQuickSort to QuickerSort Also improve the documentation and API for constructing QuickerSort and test the API
@nanosoldier |
Your job failed. |
Strange. |
The nanosoldier issue is not blocking. |
Local perf tests demonstrate that this restores previous allocation levels: julia> x = rand(Int, 10000);
julia> @btime sort!(rand!($x));
233.624 μs (3 allocations: 86.36 KiB)
julia> @btime sort!(rand!($x); alg=QuickSort);
419.169 μs (0 allocations: 0 bytes)
julia> @btime sort!(rand!($x); alg=PartialQuickSort(1:3));
7.815 μs (0 allocations: 0 bytes) |
@vtjnash probably hasn't updated the benchmark bot to the latest Nanosoldier.jl, so it might still require the @nanosoldier |
Your job failed. |
I don't understand why it failed to upload the logs for this as it should have
the log content is
|
@nanosoldier |
Your benchmark job has completed - successfully executed benchmarks. A full report can be found here. |
@nanosoldier |
Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. |
This restores the previous performance of QuickSort; the fact that it is typically an improvement is disturbing and likely connected to #47383 (comment) |
Put back the old QuickSort and PartialQuickSort, and MergeSort algorithms, rename the new PartialQuickSort to QuickerSort, improve the documentation and API for constructing QuickerSort, and test the QuickerSort API.
Most of the additions are copied verbatim from 05cfe24, the commit before #45222 which removed the old implementations of QuickSort and PartialQuickSort.
I'm open to bikesheding on the name QuickerSort. Names I already considered:
StableQuickSort
— this algorithm can be stable, but it takes a bit of extra work (which we currently always perform). In future versions of julia, perhapssort
will take astable
keyword, and ifstable
is false, then this algorithm need not perform the cheap-but-not-free reversals which stabilize it. I don't likesort(v, alg=StableQuickSort, stable=false)
.OutOfPlaceQuickSort
— this is long and fails to represent the fact that the algorithm it refers to is typically faster than quicksort.Fixes #47715
Fixes #47766
Fixes #47304 by reverting the expanded functionality that would need a compat entry (QuickerSort is still technically internal)
Closes #47297 because QuickerSort can use a fresh API with no need to deprecate any PartialQuickSort methods.