Add an API to retrieve all files from a folder that matches the speed of Win32 call
With UWP, getting the file count for 8k files using CreateFileQueryWithOptions or GetFilesAsync on a SSD will take 9 seconds.
With WPF, getting the same file count using dirInfo.GetFiles will take 10 milliseconds.
The reason for the horrible UWP file performance is that the resulting StorageFile/StorageFolder entries already contain some metadata (like attributes, mime type, date created, a "display name" which is sometimes different from the actual file name). The classic .NET FileInfo/FolderInfo objects in comparison are more or less "empty" and will delay-load those attributes when first accessed. If you enumerate all entries in WPF and access some metadata, performance is closer to UWP (but still faster).
I support this request. There should be a faster file API which only returns slim file container objects (with basically only the file name), where devs can directly trigger IO operations without accessing any metadata, plus the option to load the full StorageFile object async, when required. The full blown StorageFile/StorageFolder APIs are not needed in many scenarios, but have a high negative impact on file intensive applications. It would be great if they can be avoided.
Gavin Williams commented
Is this for real? Can we please have some acknowledgement from MS that they are aware of this issue and are working on it.