-
-
Notifications
You must be signed in to change notification settings - Fork 740
Fix Issue 15553 - topN very inefficient [slower than sort, even for topN(0)] but should be O(n) #3921
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
Conversation
andralex
commented
Jan 11, 2016
- Replace random selection with getPivot, which is also used by sort.
- Use a local copy instead of swapping range elements around when possible
- Special-case n==0, which may be either requested from the beginning or occur naturally toward the end of the search.
While at it I've also improved performance of partition (which topN uses) to use indexing for arrays. |
Ugh, I ran |
minPos is now also faster for certain ranges. |
You mean humans'? ;) |
LGTM For ndslice example (see also update #3925)
|
@9il I just invited you to the team, I guess passing a library through the review process was testing enough. You'll have the right to pull if you accept the invite. Thanks! |
@andralex Accepted. Thank you! |
ping - including @9il :) |
Fix Issue 15553 - topN very inefficient [slower than sort, even for topN(0)] but should be O(n)
How can I turn on |
@9il click on the "details" link by the "auto-tester", create an account, and then you can use the "Toggle" link in there. |