After 1. Part of this series, you can now, what is Instruments, how it works, how can you launch it and what type of analysis can you make with that. Now I'll show you, how can you use the Navigate Timeline Pane and Detail Pane. How can you hide system libraries, add flags to your Timeline at serious points, or add new Instrument to it, or check the source code in Xcode, which causes problems.
At first step you need to recording what you are actually doing with your application in your Simulator or on your Device. For the best results, it's better to use on your device that will be real data. And as I've mentioned in the first part of this series, you can use "deffered mode" to get more accurate data. (However, if you need to check the results and the process live, you don't need to use it. It depends on your app, and what would you like to check exactly.)
Click on the Red button, do your staff in your app. Try to check at first just one action, and repeat it 3-5-7 times. After that, you can stop the recording, and see the results. If there are some problems with your code, you will see at your trace some significant high results. And if you've repeated the same action, you can see the same high values at every time, when you are doing the same action. However, first just see the whole Instruments, and start to use it.
At Toolbar, you can reach the 3 Strategy buttons, the "CPU", the "Instruments", and the "Threads". These are very useful. With "CPU" you can see the Cores, with "Threads" you can see all threads which were used during the time of recording. At "Instruments" you can see the data at the timeline pane.
With "View Buttons" you can hide or show the detail pane and inspector.
With "+" button, you can add another Instrument from the Library to your Trace Document.
3.1 At Detail Pane you can see your selected Instrument's data
3.2. At "Instpector Pane" you can modify "Recording settings", "Display Settings", and you can reach "Extended Detail".
At Display Settings, you should tick "Hide System Library" -and you can see clearly! ;)
At "Extended Detail", you can see which part of your code detected. You can click on it to see your source code details. However, better first select a Range.
You can find every little settings opportunity in Instruments UserGuide.
Zoom in: with pinch Trackpad, or with Option key and drag the section on timeline Pane. (watch video) From View menu - Increase Deck Size
Zoom out: with Command key and drag the section on timeline Pane. (watch video) From View menu - Decrease Deck Size
Select Range: Drag across a section of data without using any modifier keys. Only the data you drag across is displayed.
Add Flags: With cmd + down arrow, you can add flag for later quickly reach that points. You can add different name for the flags, and in flags palette you can manage them.
At Inspector Pane at "Extended Details" you can see your source code block name, and if you click on it, you can see in Instruments your code, and which part of code cause the problem (usually we search codes of big CPU usage or Allocation issues).
You can see which part of code needs to more time to load. Of course there are many other ways to check your code, depends on your selected Instrument and type of issues, and type of App. I'll present some of useful method in the next series.
Here you can click on the Xcode little icon and Xcode Project open at that point where your code is.
The next part of the series: Instruments tutorial Part 3 - Profile Performance - CPU Usage - Time Profiler
If you would like to be notified of my new solutions, please subscribe to my Newsletter or my youtube channel and/ or follow me on Facebook or Twitter! Check Footer section for these opportunities!