Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8080945

Improve the performance of primitive Arrays.sort for certain patterns of array elements

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b69

      Backports

        Description

        When sorting an array of primitive elements the array is first analysed to see if it is nearly sorted (or actually is sorted). If nearly sorted then an optimized merge sort is performed, otherwise a dual pivot quick sort is performed.

        Improvements can be made to the this analysis of the array to better identify nearly sorted cases, such as detecting patterns that consist of equals then ascending or descending elements, and descending then ascending elements. More details can be found in the following email thread:

          http://mail.openjdk.java.net/pipermail/core-libs-dev/2015-May/033138.html

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  psandoz Paul Sandoz
                  Reporter:
                  psandoz Paul Sandoz
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: