Re: NSInteger vs int vs int32_t
Re: NSInteger vs int vs int32_t
- Subject: Re: NSInteger vs int vs int32_t
- From: Jens Alfke <email@hidden>
- Date: Mon, 02 Jul 2012 16:32:17 -0700
On Jul 2, 2012, at 4:17 PM, Kyle Sluder wrote:
>> It depends. 64-bit values are twice as big as 32-bit ones, so they use up twice as much L2 cache and RAM.
>
> I would be surprised if cache is managed at anything other than multiples of register width (64 bits).
That's not the point. Data containing 64-bit values (in objects, structs, stack frames…) is obviously bigger than data containing smaller values. There's a fairly large increase in memory usage when a process switches to 64-bit, for this reason, and it carries with it a performance hit. You can't do much about the sizes of pointers without a lot of work, but you can use smaller fields for integers where it makes sense.
—Jens
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden