Opening a folder with 10,000 files takes several seconds.
The issue is that QDirIterator is slow to check if a file name is matched in one of the filters. Basically we have 20+ filters, one for each extension allowed, and it appears it runs an RegExp with each.
We can do better than that, by making a specialized checker. QDirIterator runs fast enough without filters, so we can just manually check the result in each iteration instead.
Opening a folder with 10,000 files takes several seconds. The issue is that QDirIterator is slow to check if a file name is matched in one of the filters. Basically we have 20+ filters, one for each extension allowed, and it appears it runs an RegExp with each. We can do better than that, by making a specialized checker. QDirIterator runs fast enough without filters, so we can just manually check the result in each iteration instead.