Xcode Instruments Time Profiler Understanding which methods are taking the most time

1.9k Views Asked by At

My UI is acting choppy and I am trying to understand what the source for this is.

There are a lot of options using Xcode Instruments and I am not sure which set of them are the best for me.

From playing around with some of them it seems that most time is spent in [CALayer drawInContext] and [CALayer layoutSublayers] but I have no idea in what context those methods are called from (what part of the UI is doing that).

Which options should I be choosing in order to better understand?

Also would like to know if there is a way to see what is running in the background which doesn't belong to the current visible UI (I think something in the background may also be thrashing the CPU)

2

There are 2 best solutions below

0
On

Toogle Display of Primary Views and select:

  • Separated by Thread
  • Invert Call Tree
  • Hide System Libraries
  • Show Obj-C Only

Try to see this: http://www.raywenderlich.com/23037/how-to-use-instruments-in-xcode

1
On

Use the instruments Time Profiler instrument to record your app running on the device during its choppy moments.

Upload the instruments trace at: http://timeanalyzer.excelsis.com

It will give you a timeline view of your main thread (the main place where UI stutters occur) methods that's a lot easier to visualize than the regular instruments UI. Here's an example view:

http://timeanalyzer.excelsis.com/view.php?jobid=c7f3efc43ff85302a80515b56c0900f0