Depends...

How likely are you to need to resize arrays? How often do you need to
allocate & free them? Both of these are easier with NSArray & the
framework's reference-counting memory management. On the other hand, for
simple arrays of floats, packaging everything up into NSNumbers or NSValues
is also a bit of work.

For a size of 1000, I don't think it could matter. Move up to larger problem
sizes, and yes the overhead can become noticeable. I tried ripping out some
NSArray stuff and replaced it with std::vector<int> in code that displays a
large (>30,000) item outline view, and that got a 5% overall
improvement--not huge, but still a significant amount of time to spend in
pure overhead in a tiny portion of the logic. And this 5% was after the
big-picture optimization of the algorithms involved, which had greatly
reduced the use of the arrays in question.

The usual guideline applies--try it the easiest way first; then optimize if
you need to.

-- 
Scott Ribe
scott_r...@killerbytes.com
http://www.killerbytes.com/
(303) 722-0567 voice


_______________________________________________

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