alexbw / novocaine

Painless high-performance audio on iOS and Mac OS X
http://alexbw.github.com/novocaine/
MIT License
2.23k stars 274 forks source link

Improve performance and decrease memory use #92

Open JonasGessner opened 10 years ago

JonasGessner commented 10 years ago

The inData and outData were always being allocated even when one of them was unused. Now they are only allocated if they are actually used. Same thing with the deviceNames array.

It makes no sense to allocate it with a capacity of 100. initWithCapacity should only be used when the exact final size of the array is known. Instead, the array should dynamically change its size when new elements are added/removed.

And dispatch_one is much quicker than @synchronized.