gf2121 commented on code in PR #14751:
URL: https://github.com/apache/lucene/pull/14751#discussion_r2125719311


##########
lucene/core/src/java/org/apache/lucene/search/BlockMaxConjunctionBulkScorer.java:
##########
@@ -81,18 +83,20 @@ private float computeMaxScore(int windowMin, int windowMax) 
throws IOException {
   public int score(LeafCollector collector, Bits acceptDocs, int min, int max) 
throws IOException {
     collector.setScorer(scorable);
 
-    int windowMin = Math.max(lead.docID(), min);
+    int windowMin = scoreDocFirstUntilDynamicPruning(collector, acceptDocs, 
min, max);
+
     while (windowMin < max) {
-      // Use impacts of the least costly scorer to compute windows
       // NOTE: windowMax is inclusive
-      int windowMax = Math.min(scorers[0].advanceShallow(windowMin), max - 1);
-
-      if (0 < scorable.minCompetitiveScore) {
-        float maxWindowScore = computeMaxScore(windowMin, windowMax);
-        scoreWindowScoreFirst(collector, acceptDocs, windowMin, windowMax + 1, 
maxWindowScore);
+      int leadBlockEnd = scorers[0].advanceShallow(windowMin);
+      int windowMax = max - 1;
+      if (leadBlockEnd == DocIdSetIterator.NO_MORE_DOCS) {
+        windowMax = (int) Math.min(windowMin + DEFAULT_WINDOW_SIZE, windowMax);

Review Comment:
   Luceneutil suggests a bit regression on this change but IMO it's good
   
   ```
                               TaskQPS baseline      StdDevQPS 
my_modified_version      StdDev                Pct diff p-value
                And2Terms2StopWords      160.22      (1.9%)      154.99      
(3.4%)   -3.3% (  -8% -    2%) 0.012
                               Term     1223.04      (2.0%)     1196.56      
(3.9%)   -2.2% (  -7% -    3%) 0.141
               FilteredAndStopWords       19.77      (2.7%)       19.50      
(3.3%)   -1.4% (  -7% -    4%) 0.339
                         OrHighRare      228.67      (9.0%)      225.72     
(10.7%)   -1.3% ( -19% -   20%) 0.782
                CountFilteredPhrase       21.98      (1.8%)       21.71      
(3.9%)   -1.2% (  -6% -    4%) 0.398
                         DismaxTerm     1132.22      (1.2%)     1120.31      
(2.6%)   -1.1% (  -4% -    2%) 0.278
                FilteredAndHighHigh       23.10      (3.0%)       22.87      
(3.6%)   -1.0% (  -7% -    5%) 0.536
                           Or3Terms      149.15      (1.8%)      147.94      
(3.1%)   -0.8% (  -5% -    4%) 0.496
                     FilteredPhrase       23.39      (2.3%)       23.23      
(3.2%)   -0.7% (  -6% -    4%) 0.579
                 FilteredAndHighMed       74.38      (2.0%)       73.94      
(2.8%)   -0.6% (  -5% -    4%) 0.616
                  FilteredAnd3Terms      186.42      (2.5%)      185.41      
(3.6%)   -0.5% (  -6% -    5%) 0.708
        FilteredAnd2Terms2StopWords      132.65      (1.6%)      131.96      
(2.8%)   -0.5% (  -4% -    3%) 0.631
                   AndMedOrHighHigh       38.52      (1.7%)       38.33      
(2.8%)   -0.5% (  -4% -    3%) 0.647
                 FilteredOrHighHigh       29.08      (3.9%)       28.94      
(5.3%)   -0.5% (  -9% -    9%) 0.826
                          And3Terms      160.60      (1.7%)      159.85      
(3.2%)   -0.5% (  -5% -    4%) 0.701
                       AndStopWords       16.02      (3.0%)       15.95      
(3.4%)   -0.5% (  -6% -    6%) 0.759
                  FilteredOrHighMed       92.81      (4.1%)       92.55      
(5.6%)   -0.3% (  -9% -    9%) 0.901
                       FilteredTerm      167.12      (2.2%)      166.69      
(3.1%)   -0.3% (  -5% -    5%) 0.838
                       CombinedTerm       21.32      (1.9%)       21.27      
(1.4%)   -0.2% (  -3% -    3%) 0.793
                         AndHighMed      129.66      (1.8%)      129.49      
(3.5%)   -0.1% (  -5% -    5%) 0.919
                   FilteredOr3Terms       95.21      (4.0%)       95.09      
(5.2%)   -0.1% (  -9% -    9%) 0.954
                            Respell       79.24      (2.4%)       79.16      
(2.9%)   -0.1% (  -5% -    5%) 0.930
                 Or2Terms2StopWords      155.68      (2.3%)      155.54      
(3.1%)   -0.1% (  -5% -    5%) 0.943
                     CountOrHighMed      154.90      (2.2%)      154.90      
(3.0%)   -0.0% (  -5% -    5%) 0.998
                    FilteredPrefix3      170.31      (1.1%)      170.36      
(1.9%)    0.0% (  -2% -    2%) 0.966
                          OrHighMed      191.77      (2.3%)      191.84      
(3.4%)    0.0% (  -5% -    5%) 0.978
             CountFilteredOrHighMed       47.56      (5.7%)       47.59      
(5.9%)    0.1% ( -10% -   12%) 0.979
                     FilteredOrMany        7.88      (2.2%)        7.88      
(2.6%)    0.1% (  -4% -    4%) 0.943
                    CountOrHighHigh       88.95      (1.9%)       89.04      
(1.7%)    0.1% (  -3% -    3%) 0.908
                             Fuzzy2       91.56      (1.9%)       91.66      
(2.8%)    0.1% (  -4% -    4%) 0.922
                CountFilteredOrMany       10.61      (3.0%)       10.62      
(3.0%)    0.1% (  -5% -    6%) 0.927
            CountFilteredOrHighHigh       38.82      (4.8%)       38.87      
(5.0%)    0.1% (  -9% -   10%) 0.951
                  TermDayOfYearSort      329.47      (1.1%)      330.01      
(1.7%)    0.2% (  -2% -    2%) 0.806
                             Fuzzy1       98.98      (1.9%)       99.15      
(3.0%)    0.2% (  -4% -    5%) 0.883
                        CountOrMany       12.08      (3.2%)       12.11      
(2.8%)    0.2% (  -5% -    6%) 0.894
                         OrHighHigh       48.75      (2.0%)       48.84      
(4.2%)    0.2% (  -5% -    6%) 0.903
         FilteredOr2Terms2StopWords      109.73      (3.3%)      109.95      
(4.8%)    0.2% (  -7% -    8%) 0.916
                            Prefix3      184.21      (1.0%)      184.60      
(1.9%)    0.2% (  -2% -    3%) 0.768
                    CountAndHighMed      121.25      (3.0%)      121.51      
(3.3%)    0.2% (  -5% -    6%) 0.885
                           Wildcard      118.81      (1.4%)      119.10      
(1.9%)    0.3% (  -2% -    3%) 0.748
                      TermTitleSort      172.76      (3.0%)      173.23      
(2.6%)    0.3% (  -5% -    6%) 0.837
                   CountAndHighHigh       84.18      (1.9%)       84.41      
(1.6%)    0.3% (  -3% -    3%) 0.742
                FilteredOrStopWords       18.87      (2.9%)       18.93      
(4.1%)    0.3% (  -6% -    7%) 0.850
                        AndHighHigh       50.72      (2.3%)       50.88      
(4.0%)    0.3% (  -5% -    6%) 0.836
                      TermMonthSort     4675.04      (2.6%)     4693.23      
(3.3%)    0.4% (  -5% -    6%) 0.782
                             OrMany        9.89      (1.6%)        9.93      
(1.8%)    0.4% (  -2% -    3%) 0.587
                 CombinedAndHighMed       53.93      (1.9%)       54.19      
(1.2%)    0.5% (  -2% -    3%) 0.518
                         TermDTSort      256.25      (1.8%)      257.59      
(1.7%)    0.5% (  -2% -    4%) 0.532
                   DismaxOrHighHigh       76.05      (2.8%)       76.50      
(4.4%)    0.6% (  -6% -    8%) 0.732
                    AndHighOrMedMed       32.89      (2.8%)       33.09      
(2.0%)    0.6% (  -4% -    5%) 0.596
                CombinedAndHighHigh       11.33      (2.5%)       11.41      
(1.5%)    0.7% (  -3% -    4%) 0.494
                        OrStopWords       18.03      (3.0%)       18.16      
(4.7%)    0.7% (  -6% -    8%) 0.687
                  CombinedOrHighMed       53.59      (2.3%)       54.00      
(1.9%)    0.8% (  -3% -    5%) 0.444
                    DismaxOrHighMed      119.38      (2.1%)      120.43      
(3.2%)    0.9% (  -4% -    6%) 0.489
                          CountTerm    14480.86      (7.4%)    14622.98      
(6.9%)    1.0% ( -12% -   16%) 0.771
                 CombinedOrHighHigh       11.32      (2.8%)       11.44      
(1.8%)    1.0% (  -3% -    5%) 0.358
                             Phrase       16.28      (2.7%)       16.49      
(3.5%)    1.3% (  -4% -    7%) 0.396
   ```



-- 
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: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to