Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How expensive is it to create an NSAutoreleasePool

Tags:

cocoa

iphone

I have a method which needs to run in its own thread 88 times per second (it's a callback for an audio unit.) Should I avoid creating an NSAutoreleasePool each time it's called?

like image 234
morgancodes Avatar asked Dec 10 '22 16:12

morgancodes


1 Answers

Creating the NSAutoReleasePool itself shouldn't be too slow, but if there are a lot of objects to be dealloc'ed when you 'drain' the pool, that could start get slow. It's probably worth profiling how long the pool drains are taking.

like image 191
Alan Rogers Avatar answered Dec 27 '22 10:12

Alan Rogers