Skip to content
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

Implement a faster sort algorithm #38192

Merged
merged 2 commits into from Dec 9, 2016
Merged

Implement a faster sort algorithm #38192

merged 2 commits into from Dec 9, 2016

Commits on Dec 7, 2016

  1. Implement a faster sort algorithm

    This is a complete rewrite of the standard sort algorithm. The new algorithm
    is a simplified variant of TimSort. In summary, the changes are:
    
    * Improved performance, especially on partially sorted inputs.
    * Performs less comparisons on both random and partially sorted inputs.
    * Decreased the size of temporary memory: the new sort allocates 4x less.
    Stjepan Glavina committed Dec 7, 2016
    Configuration menu
    Copy the full SHA
    c8d73ea View commit details
    Browse the repository at this point in the history

Commits on Dec 8, 2016

  1. Inline nested fn collapse

    Since merge_sort is generic and collapse isn't, that means calls to
    collapse won't be inlined.  inlined. Therefore, we must stick an
    `#[inline]` above `fn collapse`.
    Stjepan Glavina committed Dec 8, 2016
    Configuration menu
    Copy the full SHA
    c0e150a View commit details
    Browse the repository at this point in the history