ChrisHegarty commented on PR #13370:
URL: https://github.com/apache/lucene/pull/13370#issuecomment-2112455983

   > One thing the Scorer object gave us is caching of the single vector that 
is used many times.
   > 
   > The underlying Offheap vector objects cache the vector on heap and 
prevents multiple reads.
   > 
   > Anything that calls the same random vectors twice with different ordinals, 
and those random vectors are read on heap will suffer significant performance 
issues as that on heap cache is thrashed on every comparison.
   > 
   > I didn't review fully, but wanted to ensure this performance was a 
consideration.
   
   Yes, this has been considered.
   
   Since the cache is inside the VectorValues, then this behaviour remains the 
same - scoring of the same ordinal against the same VectorValues will read the 
cached value. However, there are cases where this may not be what you want. 
Creating a separate scorer and binding the initial ordinal can, and in some 
cases does, create a separate copy of the values. In fact, maybe we should be 
consistent here - the supplier should always carry separate copies for both the 
first and second ordinals. 


-- 
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