Robin
Robin

Reputation: 8357

How does the debugger affect performance on iPhone?

I need to measure the performance of a couple of lines of code in my iPhone app. I have a macro that does the job well, but it writes the output to NSLog afterwards (with a delay to make sure that NSLog does not affect the actual performance measurement), so I always have to attach the debugger to the device to get the results.

Now I am wondering if and how the debugger affects performance of the App, eg. I imagine it doesn't affect disk reading/writing commands but probably eats up some CPU time. Are there any docs on this topic? What tools are out there to get performance measurements of apps without the effect of the debugger?

Upvotes: 1

Views: 87

Answers (2)

gcamp
gcamp

Reputation: 14672

In addition to David's answer, I would say, why don't you try it?

In Xcode 4, go to Product > Edit Scheme... > Run action > Info tab and choose Debugger "None". This way the debugger is disabled and you can test the way you like.

Upvotes: 2

Pripyat
Pripyat

Reputation: 2937

From what I have experienced, other than a jump in RAM there's no difference at all.

However, if you debug using NSZombieEnabled, you can experience some lags.

Upvotes: 1

Related Questions