major
minor
major
minor
minor
#26814
Faster resolving of files in FileManager (without Files.exists(...))
In tl:MultiFileManager, when resolving files using {{{#!java Files.exists(path) }}} , the system checks whether the file itself actually exists.
When analyzing performance during application startup or when using the tl:IconChooserControl, the tl:FileManager is used excessively while loading file system layouts (which may be theme-dependent) or parsing resources.
In the process, it was noticed that the majority of the time is spent checking whether a file exists. For JDK 8, this issue with the Files.exists(path) API is well-known (https://rules.sonarsource.com/java/RSPEC-3725). If the `path.toFile().exists() ` API is used instead, a significant performance improvement can be observed on my computer:
- The application starts in roughly 50 seconds instead of 1 minute and 30 seconds
- The IconChooser takes roughly 2 seconds instead of 17 seconds
However, the performance of file system operations depends largely on the operating system and file system. Linux (presumably ext4) seems to process these operations much more efficiently than Windows (presumably NTFS or FAT).
In JDK 11, the sluggishness of the ` File.exists(path) ` API appears to persist, although no further sources or bug reports on this issue can be found.
Test
Launch the application and open the dialog to start the IconChooser. With the changes in this ticket, the dialog should open more quickly. You can also check the time it takes to launch the application.