bruno-roustant commented on a change in pull request #1395: SOLR-14365: CollapsingQParser - Avoiding always allocate int[] and float[] with size equals to number of unique values (WIP) URL: https://github.com/apache/lucene-solr/pull/1395#discussion_r405086508
########## File path: solr/core/src/java/org/apache/solr/util/numeric/DynamicMap.java ########## @@ -17,13 +17,19 @@ package org.apache.solr.util.numeric; -import java.util.function.Consumer; -import java.util.function.IntConsumer; +import com.carrotsearch.hppc.HashContainers; -public interface IntIntMap { - void set(int key, int value); - int get(int key); - void forEachValue(IntConsumer consumer); - void remove(int key); - int size(); +public interface DynamicMap { + static boolean useArrayBased(int expectedMaxSize) { + // for small data set, prefer using array based + return expectedMaxSize < (1 << 12); Review comment: +1 ---------------------------------------------------------------- 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: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org