jpountz commented on PR #14156: URL: https://github.com/apache/lucene/pull/14156#issuecomment-2607163688
Well, you may be right as well that the cost of `MS::isLoaded` is of a similar order of magnitude as `madvise`. What the current logic does is that if you get `MS::isLoaded` to frequently return `true` (suggesting that a good share of the MS is loaded), then both the call to `MS::isLoaded` and the call to `madvise` will be skipped, this is likely where the speedup from the benchmark that I linked is coming from. What do you think of skipping the `isLoaded()` check for the first per-`IndexInput` call to `prefetch()`? This should help in the case that you identified (single prefetch() call per `IndexInput` slice instance), while not defeating the current logic to skip calls to `MS::isLoaded` / `madvise` for index inputs that appear to mostly be loaded already when doing several `prefetch()` calls on the same slice. -- 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