Re:FastImageCache – iOS library for quickly displaying image...
by mallorypaine on Monday October 21, 2013 @11:41PM
(#6589678)
Hello. Mallory Paine here. I wrote FIC. This is not legacy code...it should be trivial to convert it to ARC and performance should be unaffected. I'm a bit old school myself so I chose to write it with manual retains. Does this approach make the code more difficult for you to use within an ARC project?
[ Parent
| on HN ]
Re:FastImageCache – iOS library for quickly displaying image...
by alayne on Tuesday October 22, 2013 @01:05AM
(#6589894)
It wouldn't be our only non-ARC framework. It might be interesting to benchmark an ARC version though.
Re:FastImageCache – iOS library for quickly displaying image...
by nielsbot on Tuesday October 22, 2013 @02:09AM
(#6590051)
It might even be faster under ARC since I think the compiler can optimize some retain/release calls. I think the ARC retain and release may be faster than -retain/-release, but I'm not sure about that.
Overall, yes, it's less smooth to include non-ARC code in an ARC project.
Re:FastImageCache – iOS library for quickly displaying image...
by jdewald on Tuesday October 22, 2013 @03:37AM
(#6590299)
I was under the impression that ARC simply inserts the retain/releases into the code essentially write before the compile, so in theory would be equivalent.
Re:FastImageCache – iOS library for quickly displaying image...
by LinaLauneBaer on Tuesday October 22, 2013 @06:51AM
(#6590907)
ARC inserts the retain/release calls but once that is done there is an additional step where duplicate retain/release pairs are eliminated.
Re:FastImageCache – iOS library for quickly displaying image...
by allsystemsgo on Monday October 21, 2013 @11:44PM
(#6589689)
Why would you write it with manual retains? Who doesn't use ARC at this point?
Re:FastImageCache – iOS library for quickly displaying image...
by rbritton on Monday October 21, 2013 @11:51PM
(#6589712)
If the rest of the project is non-ARC it's easier in my experience to write new additions that way as well. I've only been using ARC on newly-created projects because having to add -fobjc-arc or -fno-objc-arc to dozens of files in Xcode is very, very tedious.
Re:FastImageCache – iOS library for quickly displaying image...
by hboon on Tuesday October 22, 2013 @01:21AM
(#6589914)
You can do a search to filter files in Xcode as well as cmd-click to select multiple files, the double click and enter the flags once for all of them.
Re:FastImageCache – iOS library for quickly displaying image...
by cclogg on Tuesday October 22, 2013 @01:04AM
(#6589890)
Actually you have my support for going manual. I still prefer to do all my projects without ARC (and I'm not old-school, unless 2009 is old-school). I just feel dirty everytime I use ARC, like I'm being sloppy haha. It also hides a lot about memory management that new people might never learn (and thus be in bigger trouble when something does go wrong). But I accept that it does have major advantages...
One trouble now is you never know if a library or whatnot will be ARC so it fragments things somewhat.