You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by "paulirwin (via GitHub)" <gi...@apache.org> on 2026/06/17 21:34:28 UTC

Re: [I] Change `FSDirectory.Open()` defaults to match .NET-specific platform and performance concerns [lucenenet]

paulirwin commented on issue #1301:
URL: https://github.com/apache/lucenenet/issues/1301#issuecomment-4735749571

   See [my comment](https://github.com/apache/lucenenet/issues/1013#issuecomment-4735696330) on #1013, w/r/t the proposed fixes in #1361.
   
   Unless we can solve the non-determinism problem with MMapDirectory cleanup in #1361, my vote is that we should _never_ return MMapDirectory by default on any platform from `FSDirectory.Open`. We should benchmark between NIOFS and SimpleFS, and choose one of those (possibly different per-platform, or maybe one for all platforms.) I spent many days going around in circles on trying to solve this, and I've run out of energy and ideas to try. If someone wants to try to solve it, my PR is open to collaboration. Even the Lucene team themselves could not solve this without the FFM API being available in Java 22+.
   
   Users can always opt-in to using MMapDirectory when it makes sense for them, and after they test it to ensure it doesn't have problems, if the extra throughput is worth the tradeoff of possibly having file handles not cleaned up until GC time.
   
   Or, perhaps the community feels like this constraint is totally a non-issue, and the performance is worth it. If so, I'm open to MMapDirectory being a default. But, in lieu of that, I'm going to vote for the conservative and safer approach that still has good general performance.


-- 
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: dev-unsubscribe@lucenenet.apache.org

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