Re: Optimizing Enormous lists in NSBrowser
Re: Optimizing Enormous lists in NSBrowser
- Subject: Re: Optimizing Enormous lists in NSBrowser
- From: Jens Alfke <email@hidden>
- Date: Fri, 18 Sep 2009 21:36:33 -0700
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 (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