Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Foo new] vs [[Foo alloc] init]:



On Feb 16, 2008, at 3:55 PM, Jonathan Dann wrote:
On 16 Feb 2008, at 23:28, Bill Bumgarner wrote:
I just checked all the way back to 10.1. The implementation was +allocWithZone: NULL followed by -init until Leopard, when it moved to +alloc followed by -init.

If the behavior had changed to anything that avoided either of those methods (keeping in mind that +alloc is a cover for +allocWithZone: until the latter was effectively deprecated as zones have fallen out of recommended practice),

So in Leopard, as you say zones have fallen out of recommended practice, does that still mean that +alloc calls +allocWithZone: or is there a new implementation of +alloc? If not then +new involves 1 more message call than +alloc -init, and could cause a slight performance loss with the extra call? Could this performance hit ever be seen, realistically speaking?

Unless you are allocating a bazillion objects, it is unlikely that the extra message would matter. More likely, all that pounding on the allocator is going to be the bulk of the cycles consumed.


In this area, what Objective C really needs is a bulk allocator. But not so much that it has risen in importance to actually implement it.

b.bum

_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: [Foo new] vs [[Foo alloc] init]: (From: Jonathan Dann <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.