On Mon, Oct 18, 2010 at 12:13 PM, Thierry Thelliez
<[hidden email]> wrote:
Assuming a large number of iterations (max 10,000) through a method
creating a temporary Array; is it ok to create an Array instance over
and over? Or should the instance be 'emptied' and reused at each call?
Well - if your code depends on the size of the array, and the size varies, then it may work to re-create it all the time. but if he size wont change, then creating the array first, and re-using it will save you the overhead of re-creating the array everytime.
But the overal best way is to try both implementations, and use the profiler to see which one works best: ProfMonitor monitorBlock: [ ]