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:29:38 UTC
[lucene] branch main 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 main
in repository https://gitbox.apache.org/repos/asf/lucene.git
The following commit(s) were added to refs/heads/main by this push:
new a7369d7f592 Remove cancellation check on every vector (#11843)
a7369d7f592 is described below
commit a7369d7f5925b7d80e68e534c5bc874fe5cd94cd
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();
}