uchiha-asha opened a new pull request, #17060: URL: https://github.com/apache/lucene/pull/17060
`TermGroupSelector.setNextReader` calls `lookupTerm` for every group value collected so far to rebuild its ordinal to group map. When segments have disjoint group values, those first-pass lookups all miss. This change only clears the map at a new segment and fills it as group ordinals are encountered. In the second pass, it defers looking up the selected groups until the first matching document with a group value in that segment. Benchmark: `GroupingSearch` (both passes) over 32,768 docs in 16 segments, top 10 groups, 4 paired JVM forks, single pinned CPU, JDK 25: Case | Before (ms CPU) | After | Change -- | -- | -- | -- disjoint group values per segment | 39.4 | 6.3 | -84% selective query (1,033 hits), disjoint | 5.7 | 1.1 | -81% 512 groups shared by all segments | 6.5 | 3.5 | -46% 8 shared groups | 3.1 | 3.1 | noise one segment | 5.2 | 5.1 | noise -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
