jpountz opened a new issue, #14650:
URL: https://github.com/apache/lucene/issues/14650

   ### Description
   
   Currently, `MMapDirectory.PRELOAD_HINT` only looks at the 
`PreloadHint.INSTANCE`. In my opinion, it should look at `FileTypeHint.INDEX` 
as well: index files are very small by contract, and file formats expect them 
to reside in memory, so it makes sense to make them preloaded to avoid cold 
starts.
   
   An alternative would be to pass the `PreloadHint.INSTANCE` hint to every 
index file, but I like this alternative less. My mental model is that index 
files are expected to reside in memory while data files are generally not, and 
the `PreloadHint.INSTANCE` hint is a flag that should be set on the small 
minority of data files that need to reside in memory for decent performance.
   
   By the way, maybe `PreloadHint` should be renamed to `InMemoryHint` or 
something along these lines, to signal that the file is expected to reside in 
memory rather than that it should be preloaded. And then preloading is a way to 
help the OS load it in memory at open time instead of waiting for it to 
naturally get loaded in memory over time as a result of the OS figuring out 
that all pages of this file are hot.


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