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/22 07:35:34 UTC

[GitHub] [lucene] jpountz commented on a diff in pull request #827: LUCENE-8836: Speed up TermsEnum#lookupOrd on increasing sequences of ords.

jpountz commented on code in PR #827:
URL: https://github.com/apache/lucene/pull/827#discussion_r855854944


##########
lucene/core/src/java/org/apache/lucene/codecs/lucene90/Lucene90DocValuesProducer.java:
##########
@@ -1112,12 +1112,17 @@ public void seekExact(long ord) throws IOException {
         throw new IndexOutOfBoundsException();
       }
       final long blockIndex = ord >>> TERMS_DICT_BLOCK_LZ4_SHIFT;
-      final long blockAddress = blockAddresses.get(blockIndex);
-      bytes.seek(blockAddress);
-      this.ord = (blockIndex << TERMS_DICT_BLOCK_LZ4_SHIFT) - 1;
-      do {
+      final long currentBlockIndex = this.ord >>> TERMS_DICT_BLOCK_LZ4_SHIFT;

Review Comment:
   Good catch! I changed the condition so that it doesn't even need a shift on the current ord.



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