Jackie-Jiang commented on a change in pull request #6559: URL: https://github.com/apache/incubator-pinot/pull/6559#discussion_r573385797
########## File path: pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/groupby/DictionaryBasedGroupKeyGenerator.java ########## @@ -831,6 +777,156 @@ private String getGroupKey(IntArray rawKey) { return groupKeyBuilder.toString(); } + /** + * Fast int-to-int hashmap with {@link #INVALID_ID} as the default return value. + * <p>Different from {@link it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap}, this map uses one single array to store + * keys and values to reduce the cache miss. + */ + @VisibleForTesting + public static class IntGroupIdMap { + private static final float LOAD_FACTOR = 0.75f; + + private int[] _keyValueHolder; + private int _capacity; + private int _mask; + private int _maxNumEntries; + private int _size; + + public IntGroupIdMap() { + _capacity = 1 << 10; + int holderSize = _capacity << 1; Review comment: Changed the initial capacity to 512 so that the array can fit into a single memory page. Added more comments also ---------------------------------------------------------------- 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 --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org