On Dec 21, 2008, at 8:23 PM, Scott Ribe wrote:

Yes, I think the key is that the expensive calculation is done only once for
each object rather than every time a comparison needs to be made.

Yes, largely. It is possible that the overhead from Objective-C method calls to a comparison selector could then be significant after that optimization
is made--but much less likely.

Have you tried using NSSortDescriptor for sorting? It caches the result of valueForKeyPath: internally, and is quite fast (as long as you don't subclass it).

--
adam


Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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