Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-10196

Improve IntroSorter with 3-ways partitioning

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 8.11
    • None
    • None
    • New

    Description

      I added a SorterBenchmark to evaluate the performance of the various Sorter implementations depending on the strategies defined in BaseSortTestCase (random, random-low-cardinality, ascending, descending, etc).

      By changing the implementation of the IntroSorter to use a 3-ways partitioning, we can gain a significant performance improvement when sorting low-cardinality lists, and with additional changes we can also improve the performance for all the strategies.

      Proposed changes:

      • Sort small ranges with insertion sort (instead of binary sort).
      • Select the quick sort pivot with medians.
      • Partition with the fast Bentley-McIlroy 3-ways partitioning algorithm.
      • Replace the tail recursion by a loop.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              broustant Bruno Roustant
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2h 20m
                  2h 20m