Add Option to ignore file name casing in IFileStore.fetchInfo() - #2952
HannesWell wants to merge 1 commit into
Conversation
|
This pull request changes some projects for the first time in this development cycle. An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch. Git patchFurther information are available in Common Build Issues - Missing version increments. |
b4fc736 to
d0d378b
Compare
|
I think you have a bug, missing files are reported as I/O errors. readDosFileAttributesIntoFileInfo catches FileNotFoundException, but NIO throws NoSuchFileException for a missing file. |
d0d378b to
4463120
Compare
Indeed. Thanks for spotting that. |
Introduce a new file-system option `EFS.IGNORE_NAME_CASE` and add a fast-path to Win32Handler in case that option is set to not determine the file's real name on the file-system. Additionally overwrite Win32Handler.listDirectoryAndGetFileInfos(String) to leverage that new fast-path, too.
4463120 to
573ad04
Compare
|
Unless there are more remarks I plan to submit this tomorrow (European) evening. |
Introduce a new file-system option
EFS.IGNORE_NAME_CASEand add a fast-path toWin32Handlerin case that option is set to not determine the file's real name on the file-system.Additionally overwrite
Win32Handler.listDirectoryAndGetFileInfos(String)to leverage that new fast-path too, similar toThis currently is based on
which introduces the methods
IFileStore.exists()andIFileStore.isDirectory(), which make it simpler to use the new option here.In a very simple benchmark I ran locally on Windows, basically just fetching the same file's info in a loop a million times, the new fast-path was almost twice as fast as the existing code.
Real numbers are probably different. For random, not previously fetched files, the difference might even be greater and the numbers probably also depend on the size of the parent directory (i.e. I assume the currently used method to be slower).