Re: Identify image file count in directory
Re: Identify image file count in directory
- Subject: Re: Identify image file count in directory
- From: Jonathan Taylor <email@hidden>
- Date: Sun, 15 Nov 2015 10:46:34 +0000
Thanks Jens & Akis for your replies.
Jens:
> Most filesystems get noticeably slower when working with directories containing large numbers of items. HFS+ does better than most, but I wouldn’t be surprised if a lot of the slowness you’re seeing is just due to filesystem overhead. If you can, try dividing up the files among multiple subdirectories and see if that helps. (For example, you could create a directory “A” for all the files whose names begin with “A”, etc.)
> I don’t know exactly how HFS+ stores directory entries, but there’s significantly more metadata for a file than just its name,
That's a fair point - and the more I think about it, the more I can see that it's going to be pretty much impossible to read this information efficiently unless the filesystem designers have gone considerably out of their way to make it fast (unlikely in this case). The all-in-one-directory problem is fairly unavoidable in my particular use case... and since they all represent one dataset then if I was to split them into multiple subdirectories (which may actually be happening at some point soon anyway) I'm just going to have to traverse the tree more deeply when scanning for files.
Akis:
> I would suggest to count the number of files asynchronously if possible, so the user doesn’t have to wait for this information in order to begin working with the panel.
Thanks v much for that suggestion (and your more details comments that followed, which I will check out). I don't know why I didn't think of doing it async except maybe just for the extra complication. I had it in my head that I needed to provide an "answer" for the preview in a callback from the OS, but that's not the case (I wonder if I was thinking back to the old carbon interface!)
Through other changes I've speeded things up a little compared to where I started from, but if it remains annoying then I'll look into making it async.
Cheers
Jonny
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden