Jackie-Jiang commented on a change in pull request #3009: [PINOT-6736] Fix min 
size for hash-set in In/NotIn predicate impl
URL: https://github.com/apache/incubator-pinot/pull/3009#discussion_r321436948
 
 

 ##########
 File path: 
pinot-common/src/main/java/com/linkedin/pinot/common/utils/HashUtil.java
 ##########
 @@ -20,6 +20,22 @@
 
 
 public class HashUtil {
+
+  /** Tests show that even for smaller set sizes, setting the hash size to 
this min value
+   * improves performance at an insignificant increase of memory footprint.
+   */
+  public static int MIN_FASTUTIL_HASHSET_SIZE = 25;
+
+  /**
+   * Returns the min size for the fast-util hash-set given the expected size of
+   * values stored in the hash-set.
+   * @param expected the expected/actual number of values to be stored
+   * @return the optimal min value
+   */
+  public static int getMinHashSetSize(int expected) {
+    return Math.min(MIN_FASTUTIL_HASHSET_SIZE, expected);
 
 Review comment:
   Missed this pr, but this min should be max right?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to