Re: Speed of Arc on iPhone
Re: Speed of Arc on iPhone
- Subject: Re: Speed of Arc on iPhone
- From: Jean-Daniel Dupas <email@hidden>
- Date: Fri, 01 Nov 2013 15:01:13 +0100
Le 1 nov. 2013 à 08:38, Gerriet M. Denkmann <email@hidden> a écrit :
> Messing with an iPhone app (iOS 7.0.3) Release build on Xcode Version 5.0.1 (5A2053) I noticed that by switching Arc off in two crucial files the speed of some operation almost doubled.
>
> So: are there any rules of thumb what to do and what not to do to avoid an Arc slowdown?
>
> Or: are there situations in which Arc is better not used?
Yes, when profiling tells you it is in a hot path.
The compiler is conservative and anytime it has some doubt, it will retain/release an object.
If profiling shows some that code where you now it is safe to avoid this additional retain/release is hot, you can help the compiler by using __unsafe_unretain to annotate the managed variable.
-- Jean-Daniel
_______________________________________________
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