Re: array performance
Re: array performance
- Subject: Re: array performance
- From: Wade Tregaskis <email@hidden>
- Date: Sat, 14 Jun 2003 11:11:46 +1000
- That the real computational expense is in the comparisons, so it
very much depends on what you're sorting
- That sorting Objective-C objects adds a lot of overhead on top of
sorting basic C data types
- That there is a scary amount of overhead in NSNumber accessor methods
These are the three most important points. They indicate that using an
NSMutableArray (or any other similar Foundation construct) for very
simple data types - ints, floats etc - is going to be painfully
inefficient.
My impression is that you should only use NSNumber when interfacing
with UI controls and the like. It's purpose is to provide flexibility
and portability - you can still get an int out of a control which
actually provides a double, etc. Everywhere else in your code, you
should use the appropriate basic construct (int, double etc).
Consequently, you should maintain your own C-style arrays of these
basic types, rather than using Foundation objects.
Wade Tregaskis
-- Sed quis custodiet ipsos custodes?
_______________________________________________
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.