Trygve Inda wrote:

This is probably true since this is a very minor part of my app... I simply need an array to display in a table with the added functionality of being able to locate a record uniquely (each object in the array has a unique ID
as one of it's properties).


I recommend doing the simplest thing that could possibly work, then measuring performance of that before making any other changes, or even thinking about changes. If simple array searching is fast enough, then you've already wasted time by thinking about how to use a dictionary, posting on the list, etc.

Furthermore, there are simple additions to linear search of an ordered array that can greatly improve speed. For example, copy the search-keys of every 100th element into another ordered array. Search it first to decide where to start a linear search in the main list, and it's guaranteed you won't have to scan more than 100 main elements. This is effectively a type of tree structure for searching, and it can be recursively applied. Even though it's simple, I wouldn't bother coding it unless actual measurements indicate a need for it.

  -- GG

_______________________________________________

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

Reply via email to