You are on page 1of 2

Never ship an app without running it through

Instruments first! Part2


In this Article we will continue Part1, so please check it first before continue Reading
Note: you can apply those steps to any of your applications, so you can discover how it's
important to use Instruments by seeing the difference on your own application, this is
Awesome!

to run Instruments select Product -> Profile or Press Command-I, this will build your code in the

Release mode, which will be fully optimized for max performance and this is totally different

from debug mode, which is aim to make debugging easy.

as we see in this image, instruments are a set of tools that measure your app performance from
different perspectives.
we will start with Time Profiler At measured intervals, Instruments halts the execution of the

program and takes a stack trace on each running thread. Think of it as employee-monitoring

software 😂😂
the result of this will be shown as a row that contains each method and the amount of time it

takes from the total execution time, needs an Example?

let's say that we run the app for about 10 milliseconds, and you take about 100 samples at every

millisecond, then the total samples captures are 1000 samples.

method "X" appears at the stack in 100 samples, this makes you conclude that the app spent

approximately 10% of the total execution time running this Method, It's a rough estimation, but it

does the job.

excited to know how to use Time Profiler, me too 😁 wait for me in the Next Article to analyze the
Time Profiler window, to be continued...

You might also like