Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lucene/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,9 @@ Optimizations
* GITHUB#16146: Speed up no-score filtered-optional Boolean queries by routing dense conjunctions with cached FixedBitSet filters
through ConstantScoreBulkScorer, which batches matches in bulk via DocIdStream. (Costin Leau)

* GITHUB#16316: Lazily allocate buffers in MaxScoreBulkScorer. These are now only allocated when going
via code paths that actually use them. (Alan Woodward)

Bug Fixes
---------------------
(No changes)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ final class MaxScoreBulkScorer extends BulkScorer {
private FixedBitSet filterMatches = null;

private final DocAndFloatFeatureBuffer docAndScoreBuffer = new DocAndFloatFeatureBuffer();
private final DocAndScoreAccBuffer docAndScoreAccBuffer;
private final DocAndScoreAccBuffer docAndScoreAccBuffer = new DocAndScoreAccBuffer();

MaxScoreBulkScorer(int maxDoc, List<Scorer> scorers, Scorer filter) throws IOException {
this.maxDoc = maxDoc;
Expand All @@ -69,8 +69,6 @@ final class MaxScoreBulkScorer extends BulkScorer {
this.cost = cost;
essentialQueue = DisiPriorityQueue.ofMaxSize(allScorers.length);
maxScoreSums = new double[allScorers.length];
docAndScoreAccBuffer = new DocAndScoreAccBuffer();
docAndScoreAccBuffer.growNoCopy(INNER_WINDOW_SIZE);

if (this.filter != null && this.filter.twoPhaseView == null && maxDoc >= INNER_WINDOW_SIZE) {
long minScorerCost = allScorers[0].cost;
Expand Down Expand Up @@ -309,6 +307,7 @@ private void collectEssentialScoresIntoWindow(
/** Flush {@link #windowMatches} and {@link #windowScores} into {@link #docAndScoreAccBuffer}. */
private void flushWindowToDocAndScoreAccBuffer(int innerWindowMin, int innerWindowSize)
throws IOException {
docAndScoreAccBuffer.growNoCopy(innerWindowSize);
docAndScoreAccBuffer.size = 0;
windowMatches.forEach(
0,
Expand Down
Loading