(minor performance) Reduce GC churn in index

This commit is contained in:
Viktor Lofgren 2023-09-24 12:12:08 +02:00
parent cd12f49fc0
commit 028b5a4f0d

View File

@ -159,8 +159,11 @@ public class IndexQueryService {
* <br>
* Then the results are combined.
* */
private final ThreadLocal<TLongArrayList> resultsArrayListPool = ThreadLocal.withInitial(TLongArrayList::new);
private TLongList evaluateSubqueries(SearchParameters params) {
final TLongArrayList results = new TLongArrayList(params.fetchSize);
final TLongArrayList results = resultsArrayListPool.get();
results.resetQuick();
results.ensureCapacity(params.fetchSize);
// These queries are various term combinations
for (var subquery : params.subqueries) {