jun7 / rox-filer

ROX file manager
24 stars 6 forks source link

save resources by checking if .hidden file exists #227

Closed JakeSFR closed 2 years ago

JakeSFR commented 2 years ago

I noticed that when I have "Enable .hidden file" option enabled and there's some substantial I/O load on my external WD drive (USB 2.0), accessing a directory on it with ~650 items takes noticeably longer than usual or with ".hidden" option disabled. And there's no .hidden file anywhere on that drive. I think it's because g_file_query_info/g_file_info_get_is_hidden are requiring/producing additional I/O load for each and every file and it's completely unnecessary if there's no .hidden file to begin with. So, I've added a test to check whether .hidden file exists in currently processed directory, before proceeding with the above. Additionaly, the check is done only when the current directory is different than the previous one, so it happens only once for a given dir.

I've been running it for a couple of days doing similar things as before and the difference is noticeable - when I'm copying a large file to that drive and try to enter that dir with ~650 items, it doesn't take 5-10 seconds anymore, but is almost instantaneous. It also feels a little snappier for other dirs.

I think the patch itself is relatively "ok" (that's the best I could come up with, anyway), but of course I'll leave the final judgement to you.

jun7 commented 2 years ago

Thank You!