ARC vs MRC(従来のretain/release)に関するベンチマークと考察。
様々な速度比較が行われているがほとんど差は無い。
ARCが遅くなると思われるケース
// this is typical MRC code: { id object = [array objectAtIndex:0]; [object doSomething]; [object doAnotherThing]; } // this is what ARC does (and what is considered best practice under MRC): { id object = [array objectAtIndex:0]; [object retain]; // inserted by ARC [object doSomething]; [object doAnotherThing]; [object release]; // inserted by ARC }
// this is typical MRC code: -(void) someMethod:(id)object { [object doSomething]; [object doAnotherThing]; } // this is what ARC does (and what is considered best practice under MRC): -(void) someMethod:(id)object { [object retain]; // inserted by ARC [object doSomething]; [object doAnotherThing]; [object release]; // inserted by ARC }
最後はそんなに速度が気になるならCで書けよ、みたいな(それを言ったら見も蓋もないが..)。