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

Reverse Timsort scan direction #107191

Merged
merged 4 commits into from
Feb 13, 2023

Commits on Jan 21, 2023

  1. Use NonNull in merge_sort

    This is more clear about the intent of the pointer and avoids problems
    if the allocation returns a null pointer.
    Voultapher committed Jan 21, 2023
    Configuration menu
    Copy the full SHA
    703ff60 View commit details
    Browse the repository at this point in the history

Commits on Jan 22, 2023

  1. Unify insertion sort implementations

    Avoid duplicate insertion sort implementations.
    Optimize implementations.
    Voultapher committed Jan 22, 2023
    Configuration menu
    Copy the full SHA
    a3065a1 View commit details
    Browse the repository at this point in the history
  2. Flip scanning direction of stable sort

    Memory pre-fetching prefers forward scanning vs backwards scanning, and the
    code-gen is usually better. For the most sensitive types such as integers, these
    are planned to be merged bidirectionally at once. So there is no benefit in
    scanning backwards.
    
    The largest perf gains are seen for full ascending and descending inputs, which
    see 1.5x speedups. Random inputs benefit too, and some patterns can loose out,
    but these losses are minimal.
    Voultapher committed Jan 22, 2023
    Configuration menu
    Copy the full SHA
    f297afa View commit details
    Browse the repository at this point in the history

Commits on Jan 23, 2023

  1. Configuration menu
    Copy the full SHA
    5eff264 View commit details
    Browse the repository at this point in the history