Using Time Profiler – Xcode Instrument To Test iOS Application

Most iOS developers start out with the desire of optimizing their iPhone app / iPad application for speed, but they aren’t very clear on the process they need to follow for the same. Under such circumstances, they employ ‘Premature Optimization’. There are some cases, though, under which the developers completely ignore or forget about their app’s optimization. Therefore, there is no element of optimization in the iPhone application development process. However, the mistake that they commit is to over rely on hardware or processor speed to salvage the app’s performance. The truth is that hardware or processor speed can’t cover up for the missing aspect in one’s app’s optimization.

What is Profiling?

Profiling means Measuring. Thus, the output of Profiling is a statistic about the utility of various codes. It will identify those codes that are used most often, and also recognize that part of the code that needs improvement.

Under the ‘Profiling’ exercise, the first instrument used is the ‘Time Profiler’. This instrument halts the execution at pre-defined intervals, and performs stack trace on every running thread. To start the process of ‘Time Profiling’, you need to select ‘Product & Profile’ from under the ‘XCode’ menu bar. This will build your application, and a new window will pop-up for the selection of the profiling template (see figure below).

Select Time Profiler from the following:

Let’s have a look at the controls that Time Profiler template provides.

Recording Controls : Allows you to control the profiling of your application.

Run Timer : Shows the amount of time for which profiling has been recorded.

Track : This displays the tracking of the profiling process by instruments. Given that only one instrument is selected here, so only one track is displayed. Depending on the selected configuration, it displays the stack depth at each sample time.

Heaviest Stack Trace (Extended detail pane) : It shows the stack of what the instrument is recording.

iOS Team @ Weblineindia

We are iOS Team @ Weblineindia.

We are energetic, adaptive and enthusiastic to explore our limits in this dynamic world of Mobile App Development. We always remains up-to-date with industry standards and trends that are followed for mobile application development. We have so far delivered applications in various domains like Business, Health & Fitness, Social Networking, Utilities and many more. We have also delivered many enterprise applications and complex architecture applications which follows SAAS model.

We have expertise in developing iPhone / iPad Applications, Universal Apps, iWatch Applications and Mac OS Applications which includes many rich features like offline data storage using core data / sqlite framework, cloud based APIs, usage of widgets and extensions, push notifications, in-app purchase functionality, siri enabled features and many more.

As a team, we are always eager to contribute back to the community and so happy to help here to our developer community on any technical problems and discussions.