• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Optimizing Enormous lists in NSBrowser
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Optimizing Enormous lists in NSBrowser


  • Subject: Re: Optimizing Enormous lists in NSBrowser
  • From: Jens Alfke <email@hidden>
  • Date: Mon, 21 Sep 2009 09:27:50 -0700


On Sep 21, 2009, at 8:28 AM, Graham Cox wrote:

Ideally if the list can't display more than, say 50 files at a time (depends on how big your screen is, etc), then it shouldn't touch more than 50 files on disk. It has never really managed that however, and maybe there are fundamental limitations in the file system that prevent it optimising to that extent.

The biggest problem is sorting, I think. The Unix filesystem APIs don't define any ordering for the items in a directory, so you have to assume items will be returned in random order. Since your list is presumably sorted, at least by name, that means you can't just read the first 50 items from the directory's catalog and display them. You have to read every entry so you can sort them all.


(In practice, the HFS+ filesystem does return filenames in alphabetical order, although I think it's just sorted by Unicode codepoint, which for non-ascii characters isn't going to be the correct localized sort order. And you still have to be able to handle other filesystems as found on memory cards and file servers...)

—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


  • Follow-Ups:
    • Re: Optimizing Enormous lists in NSBrowser
      • From: Alastair Houghton <email@hidden>
References: 
 >Re: Optimizing Enormous lists in NSBrowser (From: Scott Ribe <email@hidden>)
 >Re: Optimizing Enormous lists in NSBrowser (From: Dave DeLong <email@hidden>)
 >Re: Optimizing Enormous lists in NSBrowser (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: Any way to tell why a window is closing?
  • Next by Date: Re: NSURLConnection inserting Accept-Language and Accept headers
  • Previous by thread: Re: Optimizing Enormous lists in NSBrowser
  • Next by thread: Re: Optimizing Enormous lists in NSBrowser
  • Index(es):
    • Date
    • Thread