-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Speed up permsort by utilizing stability of the default sorting algorithm #47587
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
Draft
petvana
wants to merge
41
commits into
JuliaLang:master
Choose a base branch
from
petvana:pv/PermUnstable-v4
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 3 commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
42c70a1
initial functionality
61e4006
support 5- and 3-argument sort! for backwards compatability
901182c
test for bug that slipped through test suite
e032ba6
fix bug
e6cfee0
make send_to_end more human friendly (and less compiler friendly! int…
f160582
Give each sorting pass and DEFAULT_STABLE a docstring
15a4484
add tests and fix typos they unveiled
d82b090
avoid potential name conflict
029cbae
switch to custom keyword handling
d3bdca3
remove InsertionSortAlg and MergeSortAlg
2232cac
better algorithm display
a574c7f
stop passing U around
05de36e
remove lenm1
70290d6
fix unexpected allocations in Radix Sort
f06de10
fix doctests? I have no idea how
38f4512
support and test backwards compatability with packages that depend in…
383b9d2
Merge branch 'master' into sort-dispatch
d8ae968
improve extensibility tests
c633419
overhall scratch space handling
32a6f54
Merge branch 'master' into sort-dispatch
LilithHafner a2c2646
Consistency with other constructors
71e8fa1
Introduce PermUnstable to speed up sortperm
petvana 812c917
Fix a mistake
petvana e752ea7
pass around even fewer easily computed things in kw to reduce load on…
15666f2
Merge branch 'master' into sort-dispatch
LilithHafner 04399d9
Merge branch 'sort-dispatch' into pv/PermUnstable-v4
petvana 34621c7
Merge branch 'pv/PermUnstable-v4' into pv/PermUnstable-v5
petvana 7e6f103
Restore the PR
petvana 77b2b08
Rename to PermFast
petvana 36d3ff3
Introduce send_to_end_stable!
petvana 1fe68d9
Fix spacing
petvana dd1d89b
Fix trailing whitespace
petvana 91c2d2a
Merge branch 'master' into pv/PermUnstable-v4
petvana 20ddeb4
Small fixes
petvana c14432b
Fix sortperm!
petvana 176d779
Merge branch 'master' into pv/PermUnstable-v4
petvana a2f9710
Commit suggestion from review
petvana 2d2cf4d
De-duplicate code
petvana ef8e8eb
Merge branch 'pv/PermUnstable-v4' of github.com:petvana/julia into pv…
petvana 3b972eb
Re-use scratch array
petvana 9b5be34
Merge branch 'master' into pv/PermUnstable-v4
petvana File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@LilithHafner Btw, is
scratch
type-stable here, i.e., can compiler infer thatscratch
cannot beNothing
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recall that removing the if statement entirely introduced dynamic dispatch. IICU, all of type inference is an implementation detail, so I'm not totally sure, but I believe that we need an if statement to force union splitting though it works well whether we use
_sort!(..., nothing)
or_sort!(..., scratch)
because the compiler can determine the type ofscratch
at compile time..