Re: fast search of NSPointerArray
Re: fast search of NSPointerArray
- Subject: Re: fast search of NSPointerArray
- From: Keary Suska <email@hidden>
- Date: Sun, 23 Jun 2013 08:12:48 -0600
On Jun 22, 2013, at 9:25 PM, James Maxwell wrote:
> t's a mixed graph structure. Basically, I'm storing all unique nodes in an NSMutableArray, then using NSPointerArrays to build the adjacency lists. It works really nicely for learning/building the graph, but it does seem as though searches are a little slower. My guess is that this is because I'm now iterating over a lot of null values (which I wasn't before). But, as Graham says, I should really verify this before going any further with altering the data structures...
You might also want to consider as you are profiling that the issue may simply be the need to iterate and that a non-linear approach would work better. After you have determined where the performance issue is, posting a graph of your data structure and what it represents, including how it needs to be modified throughout its lifetime would allow listers to make recommendations on structure.
Notwithstanding the performance issue, it may be useful to periodically compact the pointer arrays. Some heuristics could be employed to minimize its impact on the user experience; e.g. at save time.
HTH,
Keary Suska
Esoteritech, Inc.
_______________________________________________
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