On Mar 27, 2014, at 3:34 PM, Roland King <r...@rols.org> wrote:

> no difference, NSInteger, NSUInteger are just typedefs for underlying 
> integral types

On 32-bit iOS, int and NSInteger are both 32-bit, so there’s no difference.
On Mac OS (and 64-bit iOS), int is 32-bit but NSInteger is 64-bit. I don’t 
actually know whether there’s any performance difference between 32- and 64-bit 
math on 64-bit processors, but you can’t just hand-wave the question away.

What _is_ different is that 64-bit numbers occupy twice as much space in the 
CPU caches, so only half as many will fit. Cache misses are orders of magnitude 
more expensive than integer math operations, so that’s the more significant 
issue.

—Jens

_______________________________________________

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to