• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: array performance
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: array performance (From: Pete Yandell <email@hidden>)

  • Prev by Date: Re: array performance
  • Next by Date: Re: Some more questions on OCUnit.
  • Previous by thread: Re: array performance
  • Next by thread: Re: array performance
  • Index(es):
    • Date
    • Thread