On Sep 17, 2009, at 2:32 PM, Dave DeLong wrote:
For normal-sized directories, this works pretty well. However, in my "worst-case" scenario of a flat directory containing 1 million files, I've found that it takes 34.8 seconds to retrieve a full directory listing (so I know how many to return in browser:numberOfRowsInColumn:), 301.5 seconds to filter the array, and another 73.6 seconds to sort it.
Have you sampled/profiled it, so you know exactly what operations are slow? (My hunch is that, at that scale, high-level Cocoa conveniences like predicates and NSFileManager are going to add a lot of overhead.)
If you want have fast operations for huge directories, you'll need to use lower-level calls, unfortunately. The most efficient call for your purposes is probably getdirentriesattr. There's a good description of it, with sample code, in "Advanced Mac OS X Programming" (Dalrymple & Hillegass.)
—Jens_______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com