dsmiley 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_r402711624
########## File path: solr/core/src/java/org/apache/solr/search/CollapsingQParserPlugin.java ########## @@ -524,6 +533,7 @@ public int docID() { public OrdScoreCollector(int maxDoc, int segments, + PrimitiveMapFactory mapFactory, Review comment: I suggest we take inspiration from two similar places in Lucene/Solr: `org.apache.lucene.util.DocIdSetBuilder` and `org.apache.solr.search.DocSetBuilder` which are doing essentially the same thing. Basically, start with a memory efficient data structure, and then once we reach a threshold, switch on the fly to a larger but more efficient structure. So start with a hash based map with a substantial initial capacity (not 4!), then upgrade to an array based map impl _instead of resizing the map_ if we exceed that capacity. This might be done with a map impl that delegates to the real impl (hppc) with switch/resize logic. ---------------------------------------------------------------- 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