From: Joe W. <jo...@gm...> - 2015-08-28 16:58:27
|
Since I'm not familiar with nio.2, I looked around for a summary of its benefits over io, and the clearest one seemed to be this: http://tutorials.jenkov.com/java-nio/nio-vs-io.html. The issues discussed are mostly over my head, but let me try a summary: Moving to nio.2 improves eXist's performance and scalability in that it allows eXist (1) to handle many more simultaneous connections (both file system but also network operations) and (2) to treat connections these as non-blocking operations. Is that about right? Also, the pull request mentioned several improvements that, and I have some questions about each item (inline): 1. File moves are now atomic. Q: as opposed to ___? 2. File copying and data copying is now handled directly by the JVM/OS. Q: as opposed to being handled by eXist homegrown code? 3. FileLock flush synchronisation is now guaranteed by the OS. Q: whereas before eXist's approach to this didn't provide this guarantee? 4. Along the way I also found many Input and Output streams that were not closed or could be left open by an exception, these have been fixed. Q: sounds like these could've led to memory leaks or file corruption? Apologies for my java-ignorance - I'm just curious to understand the benefits of these changes. They sound great! Joe |