[ 
https://issues.apache.org/jira/browse/LUCENE-9335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17340005#comment-17340005
 ] 

Zach Chen edited comment on LUCENE-9335 at 5/6/21, 5:40 AM:
------------------------------------------------------------

No problem! Writing these scorers has actually been a great exercise for me to 
understand more on the scoring related APIs and benchmark testing. I have 
enjoyed it a lot!

For the profiling, are you referring to JFR? It is currently enabled by default 
in luceneutil and I've added the result below from 5 "Med" terms queries 
(queries file _wikimedium.10M.nostopwords.tasks.5OrMeds_ attached) :

*BMM Scorer Run 1*
{code:java}
                    TaskQPS baseline      StdDevQPS my_modified_version      
StdDev                Pct diff p-value
       OrMedMedMedMedMed       40.66      (9.7%)       32.77      (7.7%)  
-19.4% ( -33% -   -2%) 0.000
                PKLookup      215.12      (1.5%)      221.56      (1.8%)    
3.0% (   0% -    6%) 0.000
{code}
CPU merged search profile for my_modified_version: 
{code:java}
PROFILE SUMMARY from 12153 events (total: 12153)
  tests.profile.mode=cpu
  tests.profile.count=30
  tests.profile.stacksize=1
  tests.profile.linenumbers=false
PERCENT       CPU SAMPLES   STACK
4.24%         515           
org.apache.lucene.search.BlockMaxMaxscoreScorer$1#doAdvance()
4.22%         513           
org.apache.lucene.search.BlockMaxMaxscoreScorer$1#updateUpToAndMaxScore()
3.11%         378           java.util.LinkedList#listIterator()
2.53%         307           java.util.LinkedList$ListItr#next()
2.42%         294           java.util.zip.Inflater#inflateBytesBytes()
2.15%         261           org.apache.lucene.search.DisiPriorityQueue#pop()
1.60%         195           jdk.internal.misc.Unsafe#getByte()
1.47%         179           
org.apache.lucene.search.BlockMaxMaxscoreScorer$2#matches()
1.41%         171           java.util.AbstractList$SubList#listIterator()
1.36%         165           java.util.AbstractList#listIterator()
1.31%         159           
org.apache.lucene.codecs.lucene90.Lucene90PostingsReader$BlockImpactsDocsEnum#advance()
1.22%         148           org.apache.lucene.search.DisiPriorityQueue#upHeap()
1.21%         147           org.apache.lucene.search.DisiPriorityQueue#add()
1.20%         146           java.util.LinkedList$ListItr#<init>()
1.15%         140           
org.apache.lucene.codecs.lucene90.blocktree.SegmentTermsEnum#seekExact()
1.11%         135           
java.util.LinkedList$ListItr#checkForComodification()
1.08%         131           
java.lang.invoke.InvokerBytecodeGenerator#isStaticallyInvocable()
1.04%         126           java.nio.DirectByteBuffer#get()
1.00%         122           java.lang.Object#wait()
1.00%         122           
org.apache.lucene.search.DisiPriorityQueue#downHeap()
0.95%         116           java.util.AbstractList$Itr#<init>()
0.82%         100           
java.util.regex.Pattern$BmpCharPredicate$$Lambda$103.530539368#is()
0.81%         98            org.apache.lucene.store.ByteBufferGuard#getByte()
0.80%         97            
org.apache.lucene.codecs.lucene90.PForUtil#innerPrefixSum32()
0.73%         89            sun.nio.fs.UnixNativeDispatcher#open0()
0.73%         89            java.lang.ClassLoader#defineClass1()
0.72%         87            
java.lang.invoke.InvokerBytecodeGenerator#emitImplicitConversion()
0.69%         84            
org.apache.lucene.codecs.lucene90.blocktree.SegmentTermsEnumFrame#loadBlock()
0.63%         77            jdk.internal.util.ArraysSupport#mismatch()
0.63%         76            
org.apache.lucene.search.BlockMaxMaxscoreScorer$1#repartitionLists()
{code}
CPU merged search profile for baseline: 
{code:java}
PROFILE SUMMARY from 9671 events (total: 9671)
  tests.profile.mode=cpu
  tests.profile.count=30
  tests.profile.stacksize=1
  tests.profile.linenumbers=false
PERCENT       CPU SAMPLES   STACK
2.96%         286           java.util.zip.Inflater#inflateBytesBytes()
1.78%         172           
org.apache.lucene.codecs.lucene90.Lucene90PostingsReader$BlockImpactsDocsEnum#advance()
1.73%         167           
org.apache.lucene.codecs.lucene90.blocktree.SegmentTermsEnum#seekExact()
1.72%         166           org.apache.lucene.search.DisiPriorityQueue#upHeap()
1.57%         152           java.lang.Object#wait()
1.57%         152           org.apache.lucene.search.DisiPriorityQueue#add()
1.51%         146           
org.apache.lucene.search.DisiPriorityQueue#downHeap()
1.43%         138           java.nio.DirectByteBuffer#get()
1.35%         131           
java.lang.invoke.InvokerBytecodeGenerator#isStaticallyInvocable()
1.15%         111           java.io.RandomAccessFile#readBytes()
1.10%         106           java.lang.ClassLoader#defineClass1()
1.07%         103           
org.apache.lucene.codecs.lucene90.Lucene90PostingsReader#findFirstGreater()
1.01%         98            org.apache.lucene.store.ByteBufferGuard#getByte()
1.01%         98            org.apache.lucene.search.WANDScorer#addTail()
1.00%         97            
org.apache.lucene.search.WANDScorer#moveToNextCandidate()
1.00%         97            java.io.UnixFileSystem#getBooleanAttributes0()
0.99%         96            sun.nio.fs.UnixNativeDispatcher#open0()
0.93%         90            
java.util.regex.Pattern$BmpCharPredicate$$Lambda$103.530539368#is()
0.90%         87            
org.apache.lucene.codecs.lucene90.PForUtil#innerPrefixSum32()
0.90%         87            java.util.Arrays#rangeCheck()
0.88%         85            
java.lang.invoke.InvokerBytecodeGenerator#emitImplicitConversion()
0.86%         83            org.apache.lucene.search.WANDScorer#advanceTail()
0.84%         81            jdk.internal.util.ArraysSupport#mismatch()
0.80%         77            org.apache.lucene.search.WANDScorer#popTail()
0.78%         75            jdk.internal.misc.Unsafe#getByte()
0.74%         72            
org.apache.lucene.codecs.lucene90.blocktree.SegmentTermsEnumFrame#loadBlock()
0.71%         69            org.apache.lucene.search.DisiPriorityQueue#pop()
0.71%         69            org.apache.lucene.search.WANDScorer$2#matches()
0.65%         63            
org.apache.lucene.codecs.lucene90.blocktree.SegmentTermsEnumFrame#scanToTermLeaf()
0.64%         62            
org.apache.lucene.search.DisiPriorityQueue#top(){code}
—

*BMM Scorer Run 2*
{code:java}
                    TaskQPS baseline      StdDevQPS my_modified_version      
StdDev                Pct diff p-value
       OrMedMedMedMedMed       36.68     (10.0%)       22.26     (10.2%)  
-39.3% ( -54% -  -21%) 0.000
                PKLookup      217.96      (9.2%)      221.95      (9.5%)    
1.8% ( -15% -   22%) 0.537{code}
CPU merged search profile for my_modified_version:
{code:java}
PROFILE SUMMARY from 15355 events (total: 15355)
  tests.profile.mode=cpu
  tests.profile.count=30
  tests.profile.stacksize=1
  tests.profile.linenumbers=false
PERCENT       CPU SAMPLES   STACK
4.04%         621           
org.apache.lucene.search.BlockMaxMaxscoreScorer$1#doAdvance()
3.30%         507           java.util.AbstractList#subList()
3.15%         484           java.util.LinkedList#listIterator()
2.40%         369           java.util.AbstractList$SubList#listIterator()
2.38%         365           org.apache.lucene.search.DisiPriorityQueue#upHeap()
2.29%         351           java.util.zip.Inflater#inflateBytesBytes()
2.10%         323           java.util.Arrays#asList()
1.95%         300           java.util.AbstractList#listIterator()
1.83%         281           jdk.internal.misc.Unsafe#getByte()
1.75%         269           org.apache.lucene.search.WANDScorer#scaleMaxScore()
1.53%         235           
org.apache.lucene.codecs.lucene90.blocktree.SegmentTermsEnum#seekExact()
1.45%         222           java.util.LinkedList$ListItr#next()
1.39%         213           
org.apache.lucene.search.BlockMaxMaxscoreScorer$2#matches()
1.35%         208           
org.apache.lucene.search.DisiPriorityQueue#downHeap()
1.32%         202           java.util.AbstractList$Itr#<init>()
1.15%         176           org.apache.lucene.search.DisiPriorityQueue#pop()
1.13%         174           java.nio.DirectByteBuffer#get()
1.04%         159           
org.apache.lucene.codecs.lucene90.Lucene90PostingsReader$BlockImpactsDocsEnum#advance()
1.03%         158           
org.apache.lucene.search.LeafSimScorer#getNormValue()
1.03%         158           java.util.AbstractList$SubList$1#nextIndex()
0.96%         148           org.apache.lucene.search.DisiPriorityQueue#top()
0.96%         147           java.util.AbstractList$Itr#next()
0.94%         145           
java.lang.invoke.InvokerBytecodeGenerator#isStaticallyInvocable()
0.83%         127           java.lang.Object#wait()
0.79%         122           org.apache.lucene.store.ByteBufferGuard#getByte()
0.69%         106           org.apache.lucene.store.DataInput#readVInt()
0.66%         102           
org.apache.lucene.codecs.lucene90.blocktree.SegmentTermsEnumFrame#loadBlock()
0.64%         98            java.lang.Math#scalb()
0.64%         98            
java.util.regex.Pattern$BmpCharPredicate$$Lambda$103.530539368#is()
0.63%         96            
org.apache.lucene.codecs.lucene90.PForUtil#innerPrefixSum32()
{code}
CPU merged search profile for baseline:
{code:java}
PROFILE SUMMARY from 11671 events (total: 11671)
  tests.profile.mode=cpu
  tests.profile.count=30
  tests.profile.stacksize=1
  tests.profile.linenumbers=false
PERCENT       CPU SAMPLES   STACK
2.96%         345           java.util.zip.Inflater#inflateBytesBytes()
2.56%         299           java.io.RandomAccessFile#readBytes()
2.29%         267           org.apache.lucene.search.DisiPriorityQueue#add()
2.04%         238           
org.apache.lucene.codecs.lucene90.Lucene90PostingsReader$BlockImpactsDocsEnum#advance()
2.01%         235           
org.apache.lucene.search.DisiPriorityQueue#downHeap()
1.97%         230           
org.apache.lucene.codecs.lucene90.blocktree.SegmentTermsEnum#seekExact()
1.91%         223           org.apache.lucene.search.DisiPriorityQueue#upHeap()
1.66%         194           java.nio.DirectByteBuffer#get()
1.48%         173           
org.apache.lucene.search.WANDScorer#moveToNextCandidate()
1.31%         153           
org.apache.lucene.codecs.lucene90.Lucene90PostingsReader#findFirstGreater()
1.29%         151           org.apache.lucene.search.WANDScorer#addTail()
1.24%         145           java.lang.Object#wait()
1.23%         143           org.apache.lucene.search.DisiPriorityQueue#pop()
1.17%         137           org.apache.lucene.search.WANDScorer#popTail()
1.11%         129           
java.lang.invoke.InvokerBytecodeGenerator#isStaticallyInvocable()
1.04%         121           
org.apache.lucene.codecs.lucene90.PForUtil#innerPrefixSum32()
1.01%         118           org.apache.lucene.search.WANDScorer$2#matches()
0.94%         110           org.apache.lucene.search.DisiPriorityQueue#top()
0.91%         106           sun.nio.fs.UnixNativeDispatcher#open0()
0.90%         105           java.io.FileInputStream#readBytes()
0.90%         105           java.lang.ClassLoader#defineClass1()
0.90%         105           org.apache.lucene.store.DataInput#readVInt()
0.90%         105           
org.apache.lucene.codecs.lucene90.blocktree.SegmentTermsEnumFrame#loadBlock()
0.83%         97            org.apache.lucene.store.ByteBufferGuard#getByte()
0.80%         93            org.apache.lucene.search.WANDScorer#advanceTail()
0.75%         88            jdk.internal.misc.Unsafe#getByte()
0.72%         84            
java.util.regex.Pattern$BmpCharPredicate$$Lambda$103.530539368#is()
0.68%         79            perf.PKLookupTask#go()
0.68%         79            java.io.UnixFileSystem#getBooleanAttributes0()
0.65%         76            org.apache.lucene.search.WANDScorer#upHeapMaxScore()

{code}
 ----

*BMM BulkScorer Run 1*
{code:java}
                    TaskQPS baseline      StdDevQPS my_modified_version      
StdDev                Pct diff p-value
       OrMedMedMedMedMed       34.58     (16.9%)       28.75      (9.0%)  
-16.9% ( -36% -   10%) 0.000
                PKLookup      223.50      (2.6%)      229.67      (2.6%)    
2.8% (  -2% -    8%) 0.001
{code}
CPU merged search profile for my_modified_version:
{code:java}
PROFILE SUMMARY from 12720 events (total: 12720)
  tests.profile.mode=cpu
  tests.profile.count=30
  tests.profile.stacksize=1
  tests.profile.linenumbers=false
PERCENT       CPU SAMPLES   STACK
3.18%         405           java.util.LinkedList#listIterator()
2.62%         333           java.util.zip.Inflater#inflateBytesBytes()
2.43%         309           
org.apache.lucene.search.BMMBulkScorer$BMMBoundaryAwareScorer$1#doAdvance()
2.21%         281           java.util.AbstractList#subList()
2.16%         275           org.apache.lucene.search.WANDScorer#scaleMaxScore()
1.96%         249           
org.apache.lucene.search.BMMBulkScorer$BMMBoundaryAwareScorer$2#matches()
1.94%         247           jdk.internal.misc.Unsafe#getByte()
1.71%         217           java.util.Arrays#asList()
1.68%         214           java.util.AbstractList#listIterator()
1.66%         211           java.util.AbstractList$SubList#listIterator()
1.63%         207           java.util.LinkedList$ListItr#next()
1.37%         174           org.apache.lucene.search.DisiPriorityQueue#upHeap()
1.26%         160           java.lang.Object#wait()
1.16%         148           
org.apache.lucene.search.LeafSimScorer#getNormValue()
1.12%         143           
org.apache.lucene.codecs.lucene90.blocktree.SegmentTermsEnum#seekExact()
1.04%         132           java.nio.DirectByteBuffer#get()
1.03%         131           
java.lang.invoke.InvokerBytecodeGenerator#isStaticallyInvocable()
1.03%         131           java.util.AbstractList$Itr#<init>()
0.96%         122           
org.apache.lucene.codecs.lucene90.Lucene90PostingsReader$BlockImpactsDocsEnum#advance()
0.91%         116           
org.apache.lucene.search.BMMBulkScorer$BMMBoundaryAwareScorer#updateIntervalBoundary()
0.90%         114           jdk.internal.util.ArraysSupport#mismatch()
0.89%         113           org.apache.lucene.search.DisiPriorityQueue#pop()
0.88%         112           java.util.AbstractList$SubList$1#nextIndex()
0.83%         105           
org.apache.lucene.search.DisiPriorityQueue#downHeap()
0.74%         94            
java.lang.invoke.InvokerBytecodeGenerator#emitImplicitConversion()
0.73%         93            org.apache.lucene.store.ByteBufferGuard#getByte()
0.73%         93            
org.apache.lucene.codecs.lucene90.PForUtil#innerPrefixSum32()
0.72%         91            sun.nio.fs.UnixNativeDispatcher#open0()
0.72%         91            org.apache.lucene.search.DisiPriorityQueue#add()
0.68%         86            org.apache.lucene.search.DisiPriorityQueue#top()
{code}
CPU merged search profile for baseline:
{code:java}
PROFILE SUMMARY from 9996 events (total: 9996)
  tests.profile.mode=cpu
  tests.profile.count=30
  tests.profile.stacksize=1
  tests.profile.linenumbers=false
PERCENT       CPU SAMPLES   STACK
3.16%         316           java.util.zip.Inflater#inflateBytesBytes()
1.89%         189           
org.apache.lucene.codecs.lucene90.Lucene90PostingsReader$BlockImpactsDocsEnum#advance()
1.74%         174           
org.apache.lucene.search.DisiPriorityQueue#downHeap()
1.73%         173           
org.apache.lucene.codecs.lucene90.blocktree.SegmentTermsEnum#seekExact()
1.65%         165           org.apache.lucene.search.DisiPriorityQueue#add()
1.63%         163           org.apache.lucene.search.DisiPriorityQueue#upHeap()
1.62%         162           java.io.RandomAccessFile#readBytes()
1.46%         146           java.lang.Object#wait()
1.41%         141           
java.lang.invoke.InvokerBytecodeGenerator#isStaticallyInvocable()
1.21%         121           org.apache.lucene.search.WANDScorer#addTail()
1.16%         116           
org.apache.lucene.codecs.lucene90.Lucene90PostingsReader#findFirstGreater()
1.11%         111           jdk.internal.util.ArraysSupport#mismatch()
1.04%         104           java.nio.DirectByteBuffer#get()
1.02%         102           
org.apache.lucene.codecs.lucene90.PForUtil#innerPrefixSum32()
1.00%         100           
java.util.regex.Pattern$BmpCharPredicate$$Lambda$103.530539368#is()
0.98%         98            org.apache.lucene.search.WANDScorer$2#matches()
0.94%         94            org.apache.lucene.search.DisiPriorityQueue#pop()
0.94%         94            org.apache.lucene.search.WANDScorer#popTail()
0.91%         91            org.apache.lucene.search.DisiPriorityQueue#top()
0.86%         86            org.apache.lucene.util.BytesRef#compareTo()
0.85%         85            org.apache.lucene.store.ByteBufferGuard#getByte()
0.82%         82            java.io.UnixFileSystem#getBooleanAttributes0()
0.79%         79            sun.nio.fs.UnixNativeDispatcher#open0()
0.78%         78            jdk.internal.misc.Unsafe#getByte()
0.77%         77            
java.lang.invoke.InvokerBytecodeGenerator#emitImplicitConversion()
0.73%         73            java.lang.ClassLoader#defineClass1()
0.73%         73            org.apache.lucene.search.WANDScorer#advanceTail()
0.70%         70            
org.apache.lucene.search.WANDScorer#moveToNextCandidate()
0.69%         69            
java.lang.invoke.InvokerBytecodeGenerator#emitStaticInvoke()
0.67%         67            perf.PKLookupTask#go(){code}
*—*

*BMM BulkScorer Run 2*
{code:java}
                    TaskQPS baseline      StdDevQPS my_modified_version      
StdDev                Pct diff p-value
       OrMedMedMedMedMed       38.91     (10.4%)       22.19      (4.1%)  
-43.0% ( -52% -  -31%) 0.000
                PKLookup      220.07      (5.4%)      226.90      (3.1%)    
3.1% (  -5% -   12%) 0.026{code}
CPU merged search profile for my_modified_version:
{code:java}
PROFILE SUMMARY from 15143 events (total: 15143)
  tests.profile.mode=cpu
  tests.profile.count=30
  tests.profile.stacksize=1
  tests.profile.linenumbers=false
PERCENT       CPU SAMPLES   STACK
3.94%         596           
org.apache.lucene.search.BMMBulkScorer$BMMBoundaryAwareScorer$1#doAdvance()
3.52%         533           java.util.AbstractList#subList()
3.20%         485           java.util.LinkedList#listIterator()
2.81%         426           java.util.AbstractList$SubList#listIterator()
2.72%         412           org.apache.lucene.search.WANDScorer#scaleMaxScore()
2.44%         369           java.util.AbstractList#listIterator()
2.37%         359           org.apache.lucene.search.DisiPriorityQueue#upHeap()
2.27%         343           java.util.Arrays#asList()
2.15%         326           java.util.zip.Inflater#inflateBytesBytes()
1.71%         259           jdk.internal.misc.Unsafe#getByte()
1.44%         218           java.util.AbstractList$Itr#<init>()
1.40%         212           
org.apache.lucene.search.DisiPriorityQueue#downHeap()
1.35%         205           java.util.LinkedList$ListItr#next()
1.33%         202           
org.apache.lucene.search.BMMBulkScorer$BMMBoundaryAwareScorer$2#matches()
1.31%         199           org.apache.lucene.search.DisiPriorityQueue#pop()
1.20%         182           java.nio.DirectByteBuffer#get()
1.10%         167           java.util.AbstractList$SubList$1#nextIndex()
1.07%         162           java.util.AbstractList$Itr#next()
0.99%         150           
org.apache.lucene.codecs.lucene90.blocktree.SegmentTermsEnum#seekExact()
0.96%         146           
org.apache.lucene.search.LeafSimScorer#getNormValue()
0.94%         143           
org.apache.lucene.codecs.lucene90.Lucene90PostingsReader$BlockImpactsDocsEnum#advance()
0.92%         139           org.apache.lucene.search.DisiPriorityQueue#top()
0.90%         137           java.lang.Object#wait()
0.79%         119           
org.apache.lucene.search.BMMBulkScorer$BMMBoundaryAwareScorer#updateIntervalBoundary()
0.77%         117           
java.lang.invoke.InvokerBytecodeGenerator#isStaticallyInvocable()
0.71%         108           java.util.AbstractList$SubList$1#<init>()
0.71%         108           org.apache.lucene.store.ByteBufferGuard#getByte()
0.67%         101           sun.nio.fs.UnixNativeDispatcher#open0()
0.66%         100           
org.apache.lucene.codecs.lucene90.PForUtil#innerPrefixSum32()
0.61%         93            java.lang.ClassLoader#defineClass1(){code}
CPU merged search profile for baseline:
{code:java}
PROFILE SUMMARY from 10813 events (total: 10813)
  tests.profile.mode=cpu
  tests.profile.count=30
  tests.profile.stacksize=1
  tests.profile.linenumbers=false
PERCENT       CPU SAMPLES   STACK
2.67%         289           org.apache.lucene.search.DisiPriorityQueue#add()
2.57%         278           java.util.zip.Inflater#inflateBytesBytes()
2.23%         241           
org.apache.lucene.search.DisiPriorityQueue#downHeap()
1.96%         212           org.apache.lucene.search.DisiPriorityQueue#upHeap()
1.91%         207           
org.apache.lucene.codecs.lucene90.Lucene90PostingsReader$BlockImpactsDocsEnum#advance()
1.65%         178           java.lang.Object#wait()
1.49%         161           java.nio.DirectByteBuffer#get()
1.36%         147           org.apache.lucene.search.DisiPriorityQueue#top()
1.34%         145           
org.apache.lucene.codecs.lucene90.Lucene90PostingsReader#findFirstGreater()
1.29%         139           
org.apache.lucene.codecs.lucene90.blocktree.SegmentTermsEnum#seekExact()
1.29%         139           org.apache.lucene.search.WANDScorer#addTail()
1.28%         138           
java.lang.invoke.InvokerBytecodeGenerator#isStaticallyInvocable()
1.17%         126           
org.apache.lucene.search.WANDScorer#moveToNextCandidate()
1.16%         125           org.apache.lucene.search.DisiPriorityQueue#pop()
1.15%         124           org.apache.lucene.search.WANDScorer$2#matches()
1.09%         118           org.apache.lucene.search.WANDScorer#popTail()
1.04%         112           org.apache.lucene.search.WANDScorer#advanceTail()
1.00%         108           org.apache.lucene.store.ByteBufferGuard#getByte()
0.96%         104           
org.apache.lucene.codecs.lucene90.PForUtil#innerPrefixSum32()
0.95%         103           
java.lang.invoke.InvokerBytecodeGenerator#emitImplicitConversion()
0.92%         99            sun.nio.fs.UnixNativeDispatcher#open0()
0.89%         96            
java.util.regex.Pattern$BmpCharPredicate$$Lambda$103.530539368#is()
0.86%         93            java.lang.ClassLoader#defineClass1()
0.83%         90            jdk.internal.misc.Unsafe#getByte()
0.80%         86            java.util.Arrays#compareUnsigned()
0.79%         85            org.apache.lucene.search.WANDScorer#upHeapMaxScore()
0.76%         82            perf.PKLookupTask#go()
0.68%         74            org.apache.lucene.search.WANDScorer#pushBackLeads()
0.68%         74            java.io.RandomAccessFile#readBytes()
0.68%         74            
org.apache.lucene.search.similarities.BM25Similarity$BM25Scorer#score()
{code}
 

I think what stands out from these comparisons is, the 2 BMM implementations 
spent a lot of CPU cycles in checking and advancing to the next candidate doc, 
whereas WAND spent time in advancing at the posting reader level. Maybe the BMM 
implementations did not propagate minScore correctly / effectively to the 
underlying scorers so that a lot more candidate docs were surfaced from 
TermScorer? Another possibility is BMM may indeed require more operations than 
BMW, as suggested by the paper. I will check more and get back to this...


was (Author: zacharymorn):
No problem! Writing these scorers has actually been a great exercise for me to 
understand more on the scoring related APIs and benchmark testing. I have 
enjoyed it a lot!

For the profiling, are you referring to JFR? It is currently enabled by default 
in luceneutil and I've added the result below from 5 "Med" terms queries 
(queries file _wikimedium.10M.nostopwords.tasks.5OrMeds_ attached) :

*BMM Scorer Run 1*
{code:java}
                    TaskQPS baseline      StdDevQPS my_modified_version      
StdDev                Pct diff p-value
       OrMedMedMedMedMed       40.66      (9.7%)       32.77      (7.7%)  
-19.4% ( -33% -   -2%) 0.000
                PKLookup      215.12      (1.5%)      221.56      (1.8%)    
3.0% (   0% -    6%) 0.000
{code}
CPU merged search profile for my_modified_version:

 
{code:java}
PROFILE SUMMARY from 12153 events (total: 12153)
  tests.profile.mode=cpu
  tests.profile.count=30
  tests.profile.stacksize=1
  tests.profile.linenumbers=false
PERCENT       CPU SAMPLES   STACK
4.24%         515           
org.apache.lucene.search.BlockMaxMaxscoreScorer$1#doAdvance()
4.22%         513           
org.apache.lucene.search.BlockMaxMaxscoreScorer$1#updateUpToAndMaxScore()
3.11%         378           java.util.LinkedList#listIterator()
2.53%         307           java.util.LinkedList$ListItr#next()
2.42%         294           java.util.zip.Inflater#inflateBytesBytes()
2.15%         261           org.apache.lucene.search.DisiPriorityQueue#pop()
1.60%         195           jdk.internal.misc.Unsafe#getByte()
1.47%         179           
org.apache.lucene.search.BlockMaxMaxscoreScorer$2#matches()
1.41%         171           java.util.AbstractList$SubList#listIterator()
1.36%         165           java.util.AbstractList#listIterator()
1.31%         159           
org.apache.lucene.codecs.lucene90.Lucene90PostingsReader$BlockImpactsDocsEnum#advance()
1.22%         148           org.apache.lucene.search.DisiPriorityQueue#upHeap()
1.21%         147           org.apache.lucene.search.DisiPriorityQueue#add()
1.20%         146           java.util.LinkedList$ListItr#<init>()
1.15%         140           
org.apache.lucene.codecs.lucene90.blocktree.SegmentTermsEnum#seekExact()
1.11%         135           
java.util.LinkedList$ListItr#checkForComodification()
1.08%         131           
java.lang.invoke.InvokerBytecodeGenerator#isStaticallyInvocable()
1.04%         126           java.nio.DirectByteBuffer#get()
1.00%         122           java.lang.Object#wait()
1.00%         122           
org.apache.lucene.search.DisiPriorityQueue#downHeap()
0.95%         116           java.util.AbstractList$Itr#<init>()
0.82%         100           
java.util.regex.Pattern$BmpCharPredicate$$Lambda$103.530539368#is()
0.81%         98            org.apache.lucene.store.ByteBufferGuard#getByte()
0.80%         97            
org.apache.lucene.codecs.lucene90.PForUtil#innerPrefixSum32()
0.73%         89            sun.nio.fs.UnixNativeDispatcher#open0()
0.73%         89            java.lang.ClassLoader#defineClass1()
0.72%         87            
java.lang.invoke.InvokerBytecodeGenerator#emitImplicitConversion()
0.69%         84            
org.apache.lucene.codecs.lucene90.blocktree.SegmentTermsEnumFrame#loadBlock()
0.63%         77            jdk.internal.util.ArraysSupport#mismatch()
0.63%         76            
org.apache.lucene.search.BlockMaxMaxscoreScorer$1#repartitionLists()
{code}
CPU merged search profile for baseline:

 

 
{code:java}
PROFILE SUMMARY from 9671 events (total: 9671)
  tests.profile.mode=cpu
  tests.profile.count=30
  tests.profile.stacksize=1
  tests.profile.linenumbers=false
PERCENT       CPU SAMPLES   STACK
2.96%         286           java.util.zip.Inflater#inflateBytesBytes()
1.78%         172           
org.apache.lucene.codecs.lucene90.Lucene90PostingsReader$BlockImpactsDocsEnum#advance()
1.73%         167           
org.apache.lucene.codecs.lucene90.blocktree.SegmentTermsEnum#seekExact()
1.72%         166           org.apache.lucene.search.DisiPriorityQueue#upHeap()
1.57%         152           java.lang.Object#wait()
1.57%         152           org.apache.lucene.search.DisiPriorityQueue#add()
1.51%         146           
org.apache.lucene.search.DisiPriorityQueue#downHeap()
1.43%         138           java.nio.DirectByteBuffer#get()
1.35%         131           
java.lang.invoke.InvokerBytecodeGenerator#isStaticallyInvocable()
1.15%         111           java.io.RandomAccessFile#readBytes()
1.10%         106           java.lang.ClassLoader#defineClass1()
1.07%         103           
org.apache.lucene.codecs.lucene90.Lucene90PostingsReader#findFirstGreater()
1.01%         98            org.apache.lucene.store.ByteBufferGuard#getByte()
1.01%         98            org.apache.lucene.search.WANDScorer#addTail()
1.00%         97            
org.apache.lucene.search.WANDScorer#moveToNextCandidate()
1.00%         97            java.io.UnixFileSystem#getBooleanAttributes0()
0.99%         96            sun.nio.fs.UnixNativeDispatcher#open0()
0.93%         90            
java.util.regex.Pattern$BmpCharPredicate$$Lambda$103.530539368#is()
0.90%         87            
org.apache.lucene.codecs.lucene90.PForUtil#innerPrefixSum32()
0.90%         87            java.util.Arrays#rangeCheck()
0.88%         85            
java.lang.invoke.InvokerBytecodeGenerator#emitImplicitConversion()
0.86%         83            org.apache.lucene.search.WANDScorer#advanceTail()
0.84%         81            jdk.internal.util.ArraysSupport#mismatch()
0.80%         77            org.apache.lucene.search.WANDScorer#popTail()
0.78%         75            jdk.internal.misc.Unsafe#getByte()
0.74%         72            
org.apache.lucene.codecs.lucene90.blocktree.SegmentTermsEnumFrame#loadBlock()
0.71%         69            org.apache.lucene.search.DisiPriorityQueue#pop()
0.71%         69            org.apache.lucene.search.WANDScorer$2#matches()
0.65%         63            
org.apache.lucene.codecs.lucene90.blocktree.SegmentTermsEnumFrame#scanToTermLeaf()
0.64%         62            
org.apache.lucene.search.DisiPriorityQueue#top(){code}
 

---

*BMM Scorer Run 2*

 
{code:java}
                    TaskQPS baseline      StdDevQPS my_modified_version      
StdDev                Pct diff p-value
       OrMedMedMedMedMed       36.68     (10.0%)       22.26     (10.2%)  
-39.3% ( -54% -  -21%) 0.000
                PKLookup      217.96      (9.2%)      221.95      (9.5%)    
1.8% ( -15% -   22%) 0.537{code}
 

CPU merged search profile for my_modified_version:

 
{code:java}
PROFILE SUMMARY from 15355 events (total: 15355)
  tests.profile.mode=cpu
  tests.profile.count=30
  tests.profile.stacksize=1
  tests.profile.linenumbers=false
PERCENT       CPU SAMPLES   STACK
4.04%         621           
org.apache.lucene.search.BlockMaxMaxscoreScorer$1#doAdvance()
3.30%         507           java.util.AbstractList#subList()
3.15%         484           java.util.LinkedList#listIterator()
2.40%         369           java.util.AbstractList$SubList#listIterator()
2.38%         365           org.apache.lucene.search.DisiPriorityQueue#upHeap()
2.29%         351           java.util.zip.Inflater#inflateBytesBytes()
2.10%         323           java.util.Arrays#asList()
1.95%         300           java.util.AbstractList#listIterator()
1.83%         281           jdk.internal.misc.Unsafe#getByte()
1.75%         269           org.apache.lucene.search.WANDScorer#scaleMaxScore()
1.53%         235           
org.apache.lucene.codecs.lucene90.blocktree.SegmentTermsEnum#seekExact()
1.45%         222           java.util.LinkedList$ListItr#next()
1.39%         213           
org.apache.lucene.search.BlockMaxMaxscoreScorer$2#matches()
1.35%         208           
org.apache.lucene.search.DisiPriorityQueue#downHeap()
1.32%         202           java.util.AbstractList$Itr#<init>()
1.15%         176           org.apache.lucene.search.DisiPriorityQueue#pop()
1.13%         174           java.nio.DirectByteBuffer#get()
1.04%         159           
org.apache.lucene.codecs.lucene90.Lucene90PostingsReader$BlockImpactsDocsEnum#advance()
1.03%         158           
org.apache.lucene.search.LeafSimScorer#getNormValue()
1.03%         158           java.util.AbstractList$SubList$1#nextIndex()
0.96%         148           org.apache.lucene.search.DisiPriorityQueue#top()
0.96%         147           java.util.AbstractList$Itr#next()
0.94%         145           
java.lang.invoke.InvokerBytecodeGenerator#isStaticallyInvocable()
0.83%         127           java.lang.Object#wait()
0.79%         122           org.apache.lucene.store.ByteBufferGuard#getByte()
0.69%         106           org.apache.lucene.store.DataInput#readVInt()
0.66%         102           
org.apache.lucene.codecs.lucene90.blocktree.SegmentTermsEnumFrame#loadBlock()
0.64%         98            java.lang.Math#scalb()
0.64%         98            
java.util.regex.Pattern$BmpCharPredicate$$Lambda$103.530539368#is()
0.63%         96            
org.apache.lucene.codecs.lucene90.PForUtil#innerPrefixSum32()
{code}
 

CPU merged search profile for baseline:

 
{code:java}
PROFILE SUMMARY from 11671 events (total: 11671)
  tests.profile.mode=cpu
  tests.profile.count=30
  tests.profile.stacksize=1
  tests.profile.linenumbers=false
PERCENT       CPU SAMPLES   STACK
2.96%         345           java.util.zip.Inflater#inflateBytesBytes()
2.56%         299           java.io.RandomAccessFile#readBytes()
2.29%         267           org.apache.lucene.search.DisiPriorityQueue#add()
2.04%         238           
org.apache.lucene.codecs.lucene90.Lucene90PostingsReader$BlockImpactsDocsEnum#advance()
2.01%         235           
org.apache.lucene.search.DisiPriorityQueue#downHeap()
1.97%         230           
org.apache.lucene.codecs.lucene90.blocktree.SegmentTermsEnum#seekExact()
1.91%         223           org.apache.lucene.search.DisiPriorityQueue#upHeap()
1.66%         194           java.nio.DirectByteBuffer#get()
1.48%         173           
org.apache.lucene.search.WANDScorer#moveToNextCandidate()
1.31%         153           
org.apache.lucene.codecs.lucene90.Lucene90PostingsReader#findFirstGreater()
1.29%         151           org.apache.lucene.search.WANDScorer#addTail()
1.24%         145           java.lang.Object#wait()
1.23%         143           org.apache.lucene.search.DisiPriorityQueue#pop()
1.17%         137           org.apache.lucene.search.WANDScorer#popTail()
1.11%         129           
java.lang.invoke.InvokerBytecodeGenerator#isStaticallyInvocable()
1.04%         121           
org.apache.lucene.codecs.lucene90.PForUtil#innerPrefixSum32()
1.01%         118           org.apache.lucene.search.WANDScorer$2#matches()
0.94%         110           org.apache.lucene.search.DisiPriorityQueue#top()
0.91%         106           sun.nio.fs.UnixNativeDispatcher#open0()
0.90%         105           java.io.FileInputStream#readBytes()
0.90%         105           java.lang.ClassLoader#defineClass1()
0.90%         105           org.apache.lucene.store.DataInput#readVInt()
0.90%         105           
org.apache.lucene.codecs.lucene90.blocktree.SegmentTermsEnumFrame#loadBlock()
0.83%         97            org.apache.lucene.store.ByteBufferGuard#getByte()
0.80%         93            org.apache.lucene.search.WANDScorer#advanceTail()
0.75%         88            jdk.internal.misc.Unsafe#getByte()
0.72%         84            
java.util.regex.Pattern$BmpCharPredicate$$Lambda$103.530539368#is()
0.68%         79            perf.PKLookupTask#go()
0.68%         79            java.io.UnixFileSystem#getBooleanAttributes0()
0.65%         76            org.apache.lucene.search.WANDScorer#upHeapMaxScore()

{code}
 ----

*BMM BulkScorer Run 1*
{code:java}
                    TaskQPS baseline      StdDevQPS my_modified_version      
StdDev                Pct diff p-value
       OrMedMedMedMedMed       34.58     (16.9%)       28.75      (9.0%)  
-16.9% ( -36% -   10%) 0.000
                PKLookup      223.50      (2.6%)      229.67      (2.6%)    
2.8% (  -2% -    8%) 0.001
{code}
CPU merged search profile for my_modified_version:

 
{code:java}
PROFILE SUMMARY from 12720 events (total: 12720)
  tests.profile.mode=cpu
  tests.profile.count=30
  tests.profile.stacksize=1
  tests.profile.linenumbers=false
PERCENT       CPU SAMPLES   STACK
3.18%         405           java.util.LinkedList#listIterator()
2.62%         333           java.util.zip.Inflater#inflateBytesBytes()
2.43%         309           
org.apache.lucene.search.BMMBulkScorer$BMMBoundaryAwareScorer$1#doAdvance()
2.21%         281           java.util.AbstractList#subList()
2.16%         275           org.apache.lucene.search.WANDScorer#scaleMaxScore()
1.96%         249           
org.apache.lucene.search.BMMBulkScorer$BMMBoundaryAwareScorer$2#matches()
1.94%         247           jdk.internal.misc.Unsafe#getByte()
1.71%         217           java.util.Arrays#asList()
1.68%         214           java.util.AbstractList#listIterator()
1.66%         211           java.util.AbstractList$SubList#listIterator()
1.63%         207           java.util.LinkedList$ListItr#next()
1.37%         174           org.apache.lucene.search.DisiPriorityQueue#upHeap()
1.26%         160           java.lang.Object#wait()
1.16%         148           
org.apache.lucene.search.LeafSimScorer#getNormValue()
1.12%         143           
org.apache.lucene.codecs.lucene90.blocktree.SegmentTermsEnum#seekExact()
1.04%         132           java.nio.DirectByteBuffer#get()
1.03%         131           
java.lang.invoke.InvokerBytecodeGenerator#isStaticallyInvocable()
1.03%         131           java.util.AbstractList$Itr#<init>()
0.96%         122           
org.apache.lucene.codecs.lucene90.Lucene90PostingsReader$BlockImpactsDocsEnum#advance()
0.91%         116           
org.apache.lucene.search.BMMBulkScorer$BMMBoundaryAwareScorer#updateIntervalBoundary()
0.90%         114           jdk.internal.util.ArraysSupport#mismatch()
0.89%         113           org.apache.lucene.search.DisiPriorityQueue#pop()
0.88%         112           java.util.AbstractList$SubList$1#nextIndex()
0.83%         105           
org.apache.lucene.search.DisiPriorityQueue#downHeap()
0.74%         94            
java.lang.invoke.InvokerBytecodeGenerator#emitImplicitConversion()
0.73%         93            org.apache.lucene.store.ByteBufferGuard#getByte()
0.73%         93            
org.apache.lucene.codecs.lucene90.PForUtil#innerPrefixSum32()
0.72%         91            sun.nio.fs.UnixNativeDispatcher#open0()
0.72%         91            org.apache.lucene.search.DisiPriorityQueue#add()
0.68%         86            org.apache.lucene.search.DisiPriorityQueue#top()
{code}
CPU merged search profile for baseline:

 

 
{code:java}
PROFILE SUMMARY from 9996 events (total: 9996)
  tests.profile.mode=cpu
  tests.profile.count=30
  tests.profile.stacksize=1
  tests.profile.linenumbers=false
PERCENT       CPU SAMPLES   STACK
3.16%         316           java.util.zip.Inflater#inflateBytesBytes()
1.89%         189           
org.apache.lucene.codecs.lucene90.Lucene90PostingsReader$BlockImpactsDocsEnum#advance()
1.74%         174           
org.apache.lucene.search.DisiPriorityQueue#downHeap()
1.73%         173           
org.apache.lucene.codecs.lucene90.blocktree.SegmentTermsEnum#seekExact()
1.65%         165           org.apache.lucene.search.DisiPriorityQueue#add()
1.63%         163           org.apache.lucene.search.DisiPriorityQueue#upHeap()
1.62%         162           java.io.RandomAccessFile#readBytes()
1.46%         146           java.lang.Object#wait()
1.41%         141           
java.lang.invoke.InvokerBytecodeGenerator#isStaticallyInvocable()
1.21%         121           org.apache.lucene.search.WANDScorer#addTail()
1.16%         116           
org.apache.lucene.codecs.lucene90.Lucene90PostingsReader#findFirstGreater()
1.11%         111           jdk.internal.util.ArraysSupport#mismatch()
1.04%         104           java.nio.DirectByteBuffer#get()
1.02%         102           
org.apache.lucene.codecs.lucene90.PForUtil#innerPrefixSum32()
1.00%         100           
java.util.regex.Pattern$BmpCharPredicate$$Lambda$103.530539368#is()
0.98%         98            org.apache.lucene.search.WANDScorer$2#matches()
0.94%         94            org.apache.lucene.search.DisiPriorityQueue#pop()
0.94%         94            org.apache.lucene.search.WANDScorer#popTail()
0.91%         91            org.apache.lucene.search.DisiPriorityQueue#top()
0.86%         86            org.apache.lucene.util.BytesRef#compareTo()
0.85%         85            org.apache.lucene.store.ByteBufferGuard#getByte()
0.82%         82            java.io.UnixFileSystem#getBooleanAttributes0()
0.79%         79            sun.nio.fs.UnixNativeDispatcher#open0()
0.78%         78            jdk.internal.misc.Unsafe#getByte()
0.77%         77            
java.lang.invoke.InvokerBytecodeGenerator#emitImplicitConversion()
0.73%         73            java.lang.ClassLoader#defineClass1()
0.73%         73            org.apache.lucene.search.WANDScorer#advanceTail()
0.70%         70            
org.apache.lucene.search.WANDScorer#moveToNextCandidate()
0.69%         69            
java.lang.invoke.InvokerBytecodeGenerator#emitStaticInvoke()
0.67%         67            perf.PKLookupTask#go(){code}
 

----

 

*BMM BulkScorer Run 2*

 
{code:java}
                    TaskQPS baseline      StdDevQPS my_modified_version      
StdDev                Pct diff p-value
       OrMedMedMedMedMed       38.91     (10.4%)       22.19      (4.1%)  
-43.0% ( -52% -  -31%) 0.000
                PKLookup      220.07      (5.4%)      226.90      (3.1%)    
3.1% (  -5% -   12%) 0.026{code}
 

CPU merged search profile for my_modified_version:

 
{code:java}
PROFILE SUMMARY from 15143 events (total: 15143)
  tests.profile.mode=cpu
  tests.profile.count=30
  tests.profile.stacksize=1
  tests.profile.linenumbers=false
PERCENT       CPU SAMPLES   STACK
3.94%         596           
org.apache.lucene.search.BMMBulkScorer$BMMBoundaryAwareScorer$1#doAdvance()
3.52%         533           java.util.AbstractList#subList()
3.20%         485           java.util.LinkedList#listIterator()
2.81%         426           java.util.AbstractList$SubList#listIterator()
2.72%         412           org.apache.lucene.search.WANDScorer#scaleMaxScore()
2.44%         369           java.util.AbstractList#listIterator()
2.37%         359           org.apache.lucene.search.DisiPriorityQueue#upHeap()
2.27%         343           java.util.Arrays#asList()
2.15%         326           java.util.zip.Inflater#inflateBytesBytes()
1.71%         259           jdk.internal.misc.Unsafe#getByte()
1.44%         218           java.util.AbstractList$Itr#<init>()
1.40%         212           
org.apache.lucene.search.DisiPriorityQueue#downHeap()
1.35%         205           java.util.LinkedList$ListItr#next()
1.33%         202           
org.apache.lucene.search.BMMBulkScorer$BMMBoundaryAwareScorer$2#matches()
1.31%         199           org.apache.lucene.search.DisiPriorityQueue#pop()
1.20%         182           java.nio.DirectByteBuffer#get()
1.10%         167           java.util.AbstractList$SubList$1#nextIndex()
1.07%         162           java.util.AbstractList$Itr#next()
0.99%         150           
org.apache.lucene.codecs.lucene90.blocktree.SegmentTermsEnum#seekExact()
0.96%         146           
org.apache.lucene.search.LeafSimScorer#getNormValue()
0.94%         143           
org.apache.lucene.codecs.lucene90.Lucene90PostingsReader$BlockImpactsDocsEnum#advance()
0.92%         139           org.apache.lucene.search.DisiPriorityQueue#top()
0.90%         137           java.lang.Object#wait()
0.79%         119           
org.apache.lucene.search.BMMBulkScorer$BMMBoundaryAwareScorer#updateIntervalBoundary()
0.77%         117           
java.lang.invoke.InvokerBytecodeGenerator#isStaticallyInvocable()
0.71%         108           java.util.AbstractList$SubList$1#<init>()
0.71%         108           org.apache.lucene.store.ByteBufferGuard#getByte()
0.67%         101           sun.nio.fs.UnixNativeDispatcher#open0()
0.66%         100           
org.apache.lucene.codecs.lucene90.PForUtil#innerPrefixSum32()
0.61%         93            java.lang.ClassLoader#defineClass1(){code}
 

CPU merged search profile for baseline:

 
{code:java}
PROFILE SUMMARY from 10813 events (total: 10813)
  tests.profile.mode=cpu
  tests.profile.count=30
  tests.profile.stacksize=1
  tests.profile.linenumbers=false
PERCENT       CPU SAMPLES   STACK
2.67%         289           org.apache.lucene.search.DisiPriorityQueue#add()
2.57%         278           java.util.zip.Inflater#inflateBytesBytes()
2.23%         241           
org.apache.lucene.search.DisiPriorityQueue#downHeap()
1.96%         212           org.apache.lucene.search.DisiPriorityQueue#upHeap()
1.91%         207           
org.apache.lucene.codecs.lucene90.Lucene90PostingsReader$BlockImpactsDocsEnum#advance()
1.65%         178           java.lang.Object#wait()
1.49%         161           java.nio.DirectByteBuffer#get()
1.36%         147           org.apache.lucene.search.DisiPriorityQueue#top()
1.34%         145           
org.apache.lucene.codecs.lucene90.Lucene90PostingsReader#findFirstGreater()
1.29%         139           
org.apache.lucene.codecs.lucene90.blocktree.SegmentTermsEnum#seekExact()
1.29%         139           org.apache.lucene.search.WANDScorer#addTail()
1.28%         138           
java.lang.invoke.InvokerBytecodeGenerator#isStaticallyInvocable()
1.17%         126           
org.apache.lucene.search.WANDScorer#moveToNextCandidate()
1.16%         125           org.apache.lucene.search.DisiPriorityQueue#pop()
1.15%         124           org.apache.lucene.search.WANDScorer$2#matches()
1.09%         118           org.apache.lucene.search.WANDScorer#popTail()
1.04%         112           org.apache.lucene.search.WANDScorer#advanceTail()
1.00%         108           org.apache.lucene.store.ByteBufferGuard#getByte()
0.96%         104           
org.apache.lucene.codecs.lucene90.PForUtil#innerPrefixSum32()
0.95%         103           
java.lang.invoke.InvokerBytecodeGenerator#emitImplicitConversion()
0.92%         99            sun.nio.fs.UnixNativeDispatcher#open0()
0.89%         96            
java.util.regex.Pattern$BmpCharPredicate$$Lambda$103.530539368#is()
0.86%         93            java.lang.ClassLoader#defineClass1()
0.83%         90            jdk.internal.misc.Unsafe#getByte()
0.80%         86            java.util.Arrays#compareUnsigned()
0.79%         85            org.apache.lucene.search.WANDScorer#upHeapMaxScore()
0.76%         82            perf.PKLookupTask#go()
0.68%         74            org.apache.lucene.search.WANDScorer#pushBackLeads()
0.68%         74            java.io.RandomAccessFile#readBytes()
0.68%         74            
org.apache.lucene.search.similarities.BM25Similarity$BM25Scorer#score()
{code}
 

I think what stands out from these comparisons is, the 2 BMM implementations 
spent a lot of CPU cycles in checking and advancing to the next candidate doc, 
whereas WAND spent time in advancing at the posting reader level. Maybe the BMM 
implementations did not propagate minScore correctly / effectively to the 
underlying scorers so that a lot more candidate docs were surfaced from 
TermScorer? Another possibility is BMM may indeed require more operations than 
BMW, as suggested by the paper. I will check more and get back to this...

> Add a bulk scorer for disjunctions that does dynamic pruning
> ------------------------------------------------------------
>
>                 Key: LUCENE-9335
>                 URL: https://issues.apache.org/jira/browse/LUCENE-9335
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Adrien Grand
>            Priority: Minor
>         Attachments: wikimedium.10M.nostopwords.tasks, 
> wikimedium.10M.nostopwords.tasks.5OrMeds
>
>          Time Spent: 2h 40m
>  Remaining Estimate: 0h
>
> Lucene often gets benchmarked against other engines, e.g. against Tantivy and 
> PISA at [https://tantivy-search.github.io/bench/] or against research 
> prototypes in Table 1 of 
> [https://cs.uwaterloo.ca/~jimmylin/publications/Grand_etal_ECIR2020_preprint.pdf].
>  Given that top-level disjunctions of term queries are commonly used for 
> benchmarking, it would be nice to optimize this case a bit more, I suspect 
> that we could make fewer per-document decisions by implementing a BulkScorer 
> instead of a Scorer.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to