• 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
Optimizing NSMutableDictionary Speed
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Optimizing NSMutableDictionary Speed


  • Subject: Optimizing NSMutableDictionary Speed
  • From: John Nairn <email@hidden>
  • Date: Fri, 11 Apr 2003 09:20:10 -0600

I am thinking of converting an application to Cocoa that may deal with a large number of records. The data model fits logically into an NSMutableDictionary with record IDs (which are unique) as keys. The concern is how NSMutableDictionary will respond to frequent searching by key? Typically files will have thousands of records; and an extreme file might have a million records. Use of the application will require frequent location of records by key.

All code examples I have seen use NSString's for keys in dictionaries, but the documentation alludes to keys being any kind of object as long as it responds to certain protocols. Are there ways to improve the efficiency of dictionaries by defining key objects that might get located faster?

------------
John Nairn (1-801-581-3413, FAX: 1-801-581-4816)
Web page: http://www.mse.utah.edu/~nairn
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Optimizing NSMutableDictionary Speed
      • From: Timothy Ritchey <email@hidden>
  • Prev by Date: Re: NSMutableDictionary not sending release message to contained objects at dealloc time
  • Next by Date: Re: General release rule
  • Previous by thread: Re: Cocoa Window Not Activated When Called From Carbon Application
  • Next by thread: Re: Optimizing NSMutableDictionary Speed
  • Index(es):
    • Date
    • Thread