Oops - I meant to say it's an NSMutableDictionary! What might a quick stubbed example of that be? Not sure I am following. How much speed would it generally gain?
Google Voice: (508) 656-0622 Twitter: eric_dolecki XBoxLive: edolecki PSN: eric_dolecki http://blog.ericd.net On Tue, Jul 19, 2011 at 9:22 AM, Vincent Habchi <vi...@macports.org> wrote: > > I have an NSMutableArray that contains a MPMediaItem and song title as > it's > > key. > > > > I then take a search string and loop through the entire NSMutableArray > > looking for a fuzzy match. It works very well, the problem is that the > array > > contains 1,777 items (could contain more) and the search takes about 6 > > seconds on iOS. I am wondering how I could optimize this to get the > search > > time down. I was thinking of splitting the array into 2 or something, > just > > not really sure what the best approach might be. > > It's not easy, but I would recommend using a hash table instead. You can > compute a hash code that depends more or less on the spelling of your > strings, then use that hash key to access a set of candidate for your fuzzy > search. > > Vincent _______________________________________________ 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