Yes, creating a large number of instances with auto-implementation on the iPhone can create memory problems, especially in a closed loop, so I try to avoid them when I can. You can create your own auto-detection pools to manage this, but they will also add some performance overhead and additional code that you need to track.
It is for this reason that when I perform precision calculations, I prefer to use NSDecimal C struct instead of NSDecimalNumbers. In fact, I performed some tests on this issue and found a significant performance increase when working with the C-structure (copied from my answer here ):
NSDecimal Additions per second: 3355476.75 Subtractions per second: 3866671.27 Multiplications per second: 3458770.51 Divisions per second: 276242.32 NSDecimalNumber Additions per second: 676901.32 Subtractions per second: 671474.6 Multiplications per second: 720310.63 Divisions per second: 190249.33
As you can see, almost 5 times the computational speed between NSDecimal paths and NSDecimalNumber. The biggest difference between NSDecimal and NSDecimalNumber calculations was the memory allocation of NSDecimalNumber instances. Therefore, you should avoid allocating temporary instances with auto-implementation, wherever you are.
source share