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:
Benjamin Trent 2022-10-13 12:29:33 -04:00 committed by GitHub
parent 3a608995a1
commit a7369d7f59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 2 deletions

View File

@ -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();
}