Class SparseConstants

java.lang.Object
io.deephaven.engine.table.impl.sources.sparse.SparseConstants

public class SparseConstants extends Object
  • Field Details

  • Constructor Details

    • SparseConstants

      public SparseConstants()
  • Method Details

    • sparseStructureExceedsOverhead

      public static boolean sparseStructureExceedsOverhead(RowSet rowSet, double maximumOverhead)
      When using sparse data structures, a single entry within a block can result in the data size increasing by a factor of BLOCK_SIZE. On the other hand, we would strongly prefer the sparse results because they are generally much faster than the alternatives.

      To balance those concerns, we can determine if a given rowSet exceeds some overhead threshold and act accordingly.

      Parameters:
      rowSet - the Index that we should calculate the overhead for
      maximumOverhead - the maximum overhead as a fraction (e.g. 1.1 is 10% overhead). Values less than zero disable overhead checking, and result in always using the sparse structure. A value of zero results in never using the sparse structure.