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


##########
lucene/core/src/java21/org/apache/lucene/store/MemorySegmentIndexInput.java:
##########
@@ -370,6 +370,16 @@ public void prefetch(long offset, long length) throws 
IOException {
     }
   }
 
+  @Override
+  public void readAhead(long offset, long length) throws IOException {
+    // Start loading the first bytes in the background
+    if (length != 0) {
+      prefetch(offset, 1);
+    }
+    // TODO: Is there a hint we can give to the OS to let it optimize for our 
forward-only access
+    // pattern in the given range?
+  }

Review Comment:
   I thought you had concerns about `MADV_NORMAL` but I like it better too, I 
updated the PR to use `ReadAdvice.NORMAL` instead.



-- 
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-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to