You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2022/04/06 21:26:11 UTC
[GitHub] [lucene] jtibshirani commented on a diff in pull request #796: LUCENE-10504: KnnGraphTester to use KnnVectorQuery
jtibshirani commented on code in PR #796:
URL: https://github.com/apache/lucene/pull/796#discussion_r844431197
##########
lucene/core/src/test/org/apache/lucene/util/hnsw/KnnGraphTester.java:
##########
@@ -362,18 +367,19 @@ private void testSearch(Path indexPath, Path queryPath, Path outputPath, int[][]
long cpuTimeStartNs;
try (Directory dir = FSDirectory.open(indexPath);
DirectoryReader reader = DirectoryReader.open(dir)) {
+ IndexSearcher searcher = new IndexSearcher(reader);
numDocs = reader.maxDoc();
for (int i = 0; i < warmCount; i++) {
// warm up
targets.get(target);
- results[i] = doKnnSearch(reader, KNN_FIELD, target, topK, fanout);
+ doKnnSearch(reader, KNN_FIELD, target, topK, fanout);
Review Comment:
Would it be fine to use `doKnnVectorQuery` here so we could delete `doKnnSearch`?
##########
lucene/core/src/test/org/apache/lucene/util/hnsw/KnnGraphTester.java:
##########
@@ -349,8 +353,9 @@ private void testSearch(Path indexPath, Path queryPath, Path outputPath, int[][]
TopDocs[] results = new TopDocs[numIters];
long elapsed, totalCpuTime, totalVisited = 0;
try (FileChannel q = FileChannel.open(queryPath)) {
+ int bufferSize = Math.max(numIters, warmCount) * dim * Float.BYTES;
Review Comment:
Maybe we could just assert warmCount < numIters, seems unusual to warm up with queries that you don't use in the benchmark?
--
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-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org