Class TimsortUtils

java.lang.Object
io.deephaven.engine.table.impl.sort.timsort.TimsortUtils

public class TimsortUtils extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The initial setting for the number of consecutive values taken from either run1 or run2 before we switch to galloping mode.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    getRunLength(int length)
    Given a length of our input, we should pick a number that is between 32 and 64; ideally such that (length / run) is just under 2^n < length, but only by a little bit.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • INITIAL_GALLOP

      public static final int INITIAL_GALLOP
      The initial setting for the number of consecutive values taken from either run1 or run2 before we switch to galloping mode.
      See Also:
  • Constructor Details

    • TimsortUtils

      public TimsortUtils()
  • Method Details

    • getRunLength

      public static int getRunLength(int length)
      Given a length of our input, we should pick a number that is between 32 and 64; ideally such that (length / run) is just under 2^n < length, but only by a little bit. Take the six most significant bits of length; if the remaining bits have any ones, then add one.
      Parameters:
      length - the length of the values within a chunk to sort
      Returns:
      the run length