Re: fast search of NSPointerArray
Re: fast search of NSPointerArray
- Subject: Re: fast search of NSPointerArray
- From: Michael Crawford <email@hidden>
- Date: Sat, 22 Jun 2013 20:07:13 -0700
Would the C++ Standard Template Library help?
One can compile "Objective-C++" by giving such sources the ".mm" extension.
In general there are data structure templates, and algorithm templates
- search a vector, search a tree, search a linked list, sort a vector,
etc.
The algorithms all have specific, well-documented runtime guarantees.
It's hard to read its source code, but it _is_ all available in the
STL header files. There's lots of good books and online tutorials
about it.
On Sat, Jun 22, 2013 at 7:56 PM, James Maxwell
<email@hidden> wrote:
> Hello All,
>
> I've recently been working on an optimized version of a pretty complex project. The big problem before was memory usage, and I'm happy to say that I've tackled that really well. However, in order to do this I switched from using NSMutableDictionaries to sparse NSPointerArrays. On the down side, I'm finding that the new build is a little bit slower -- an outcome I really didn't expect. Thinking through it a bit, it occurred to me that it may be because my data structures are now sparse arrays, with the data stored by index, and thus generally contain a fairly large number of null values. I'm thinking that my iterations may have slowed down because of the sparseness. Is there some decent way around this?
>
> I've thought creating my sparse arrays using NSHashTable (keyed by NSIntegers) instead of NSPointerArray. Does this seem like a reasonable way to speed things up?
>
> J.
> _______________________________________________
>
> 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
--
Michael David Crawford
mdcrawford at gmail dot com
Custom Software Development for the iPhone and Mac OS X
http://www.dulcineatech.com/custom-software-development/
_______________________________________________
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