Enhancement
Major
Detail
Major
Detail
Detail
#26814
Faster resolving of files in FileManager (without Files.exists(...))
In tl:MultiFileManager, when resolving files, {{#!java Files.exists(path) }} is used to check whether the file itself exists at all.
When analyzing the performance at application startup or when using the tl:IconChooserControl, the tl:FileManager is excessively needed when loading the possibly theme-dependent file system layouts or parsing resources.
In the course of this it has been noticed that most of the time is spent checking the existence of a file. For JDK 8 the problem with the API Files.exists(path) is known(https://rules.sonarsource.com/java/RSPEC-3725). If the API path.toFile().exists() is used instead, a significant performance gain can be seen on my machine:
- The application starts in about 50 seconds instead of 1:30 minutes.
- The IconChooser needs about 2 seconds instead of 17 seconds
However, the performance of the file system operations depends largely on the operating system or file system. Linux (probably ext4) seems to process the operations much more perfomantly than Windows (probably ntfs or fat).
In JDK 11 the sluggishness of the File.exists(path) API seems to persist, although no further sources or bug reports can be found on this.
Test
Start the application and open the dialog to start the IconChooser. With the changes in this ticket, the dialog should open more quickly. The time to start the application can also be checked.