mikeash.com: just this guy, you know?

NSBlog
RSS feed (full text feed)

autorelease(2) bug cocoa(2) objective-c(2) performance

Showing entries tagged "autorelease". Full blog index.

More Fun With Autorelease at 2007-02-08 00:00
Tags: autorelease bug cocoa objective-c I just hit a subtle but commonly known bug for the first time. I thought I'd share my fun with the world. Everybody reading this blog should know about autorelease pools and how they work in Cocoa. As everybody knows, every time you go through the event loop, Cocoa blows away the old pool and makes a new one for you, so that all of your autoreleased objects go away and your new ones go into a fresh pool. That way you never build up more objects than get produced during a single event loop cycle.
(Read More) 10 comments

Autorelease is Fast at 2006-06-07 00:00
Tags: autorelease performance cocoa objective-c If you've done much Cocoa programming, you've probably run into a situation where you needed to create a local autorelease pool because of some sort of loop. And you've probably run into advice telling you not to create and destroy the pool for every iteration, because that would be slow. I never believed that it could be significant, and I finally took the time to test it today. What's the verdict? Just as I thought, making autorelease pools is really fast.
(Read More) 13 comments