Are there any concrete study of the performance impact of using ARC?

后端 未结 5 690
挽巷
挽巷 2021-02-05 17:31

I could not find an objective study regarding ARC performance impact in a real life project. The official doc says

The compiler efficiently eliminates many

5条回答
  •  攒了一身酷
    2021-02-05 18:29

    I think that if you get a similar performance regression the only possible explanation is that your manual managed code was "unsafe", i mean there were potential memory leaks and less retain/release calls that made the program memory management in some way unsafe .

    I don't think that ARC code is so slower than manually managed one, if the manually managed is well written and safe ...

    Of course I think too that a manually managed code well written could be slightly faster than an ARC one, but at what cost ? A lot more work to do by hand ... In most cases it is more trouble than it is worth !

    In addition, I think that ARC should be compared with a Garbage Collector environment and not with a perfect written MRC, a man brain will ever be smarter than a program (or at least I hope so ... :-) ) ...

    However if you have a well written MRC code base and you are really sure that is safe and faster, why put it under ARC ? Keep it manually memory managed, using -fno-objc-arc flag ... Using ARC is not mandatory especially for these kind of reasons .

提交回复
热议问题