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 2021/01/19 14:52:49 UTC

[GitHub] [lucene-solr] msokolov commented on a change in pull request #2214: LUCENE-9674:Faster advance on Vector Values

msokolov commented on a change in pull request #2214:
URL: https://github.com/apache/lucene-solr/pull/2214#discussion_r560234117



##########
File path: lucene/core/src/java/org/apache/lucene/codecs/lucene90/Lucene90VectorReader.java
##########
@@ -387,8 +387,40 @@ public int nextDoc() {
 
     @Override
     public int advance(int target) throws IOException {
-      // We could do better by log-binary search in ordToDoc, but this is never used
-      return slowAdvance(target);
+      assert docID() < target;
+      int idx = binarySearch(target);

Review comment:
       I think we could, we would pay the very small cost of decoding the negative values it returns (and it must encode them), when we don't care about the distinction of present/not-present, but probably that's not significant and we avoid the cost of maintaining our own binary search here. +1




----------------------------------------------------------------
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.

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