spillerrec / imgviewer

Customizable image viewer with minimalistic interface
2 stars 1 forks source link

Opening folder with many files is slow #34

Closed spillerrec closed 9 years ago

spillerrec commented 9 years ago

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.