You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ju...@apache.org on 2022/10/13 16:31:54 UTC

[lucene] branch branch_9x updated: Remove cancellation check on every vector (#11843)

This is an automated email from the ASF dual-hosted git repository.

julietibs pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/lucene.git


The following commit(s) were added to refs/heads/branch_9x by this push:
     new dc527ec6105 Remove cancellation check on every vector (#11843)
dc527ec6105 is described below

commit dc527ec6105071f21fd8e3aa2c170f1caab119b9
Author: Benjamin Trent <be...@gmail.com>
AuthorDate: Thu Oct 13 12:29:33 2022 -0400

    Remove cancellation check on every vector (#11843)
    
    We recently introduced support for kNN vectors to `ExitableDirectoryReader`.
    Previously, we checked for cancellation not only on sampled calls `advance`,
    but on every single call to `vectorValue`. This can cause significant overhead
    when a query scans many vector values (for example the case where you're doing
    an exact scan and computing a vector similarity for every matching document).
    
    This PR removes the cancellation checks on `vectorValue`, since having them on
    `advance` is already enough.
---
 .../core/src/java/org/apache/lucene/index/ExitableDirectoryReader.java  | 2 --
 1 file changed, 2 deletions(-)

diff --git a/lucene/core/src/java/org/apache/lucene/index/ExitableDirectoryReader.java b/lucene/core/src/java/org/apache/lucene/index/ExitableDirectoryReader.java
index 9f5ae09b141..4f8d2ae61d3 100644
--- a/lucene/core/src/java/org/apache/lucene/index/ExitableDirectoryReader.java
+++ b/lucene/core/src/java/org/apache/lucene/index/ExitableDirectoryReader.java
@@ -430,13 +430,11 @@ public class ExitableDirectoryReader extends FilterDirectoryReader {
 
       @Override
       public float[] vectorValue() throws IOException {
-        checkAndThrow();
         return in.vectorValue();
       }
 
       @Override
       public BytesRef binaryValue() throws IOException {
-        checkAndThrow();
         return in.binaryValue();
       }