mirror of https://github.com/apache/lucene.git
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.
This commit is contained in:
parent
3a608995a1
commit
a7369d7f59
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue