With ARC, what's better: alloc or autorelease initializers?

后端 未结 6 550
情书的邮戳
情书的邮戳 2020-11-29 01:19

Is it better (faster & more efficient) to use alloc or autorelease initializers. E.g.:

- (NSString *)hello:(NSString *)name {
          


        
6条回答
  •  情深已故
    2020-11-29 01:57

    Comparing the performance of the two is a bit of a moot issue for a couple of reasons. First, the performance characteristics of the two might change as Clang evolves, and new optimisations are added to the compiler. Second, the benefits of skipping a few instructions here and there are dubious at best. The performance of your app should be considered across method boundaries. Deconstructing one method can be deceiving.

提交回复
热议问题